PageRenderTime 25ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/extensions/lightbox/ELightBoxWidget.php

http://phundament.googlecode.com/
PHP | 102 lines | 66 code | 14 blank | 22 comment | 0 complexity | 26f606eb221b1e35b4f6734010a8387b MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0
  1. <?php
  2. /**
  3. * Class File
  4. *
  5. * @author Marc Mautz <m.mautz@herzogkommunikation.de>
  6. * @link http://www.phundament.com/
  7. * @copyright Copyright &copy; 2005-2010 diemeisterei GmbH
  8. * @license http://www.phundament.com/license/
  9. */
  10. /**
  11. * Description ...
  12. *
  13. * Detailed info
  14. * <pre>
  15. * $var = code_example();
  16. * </pre>
  17. * {@link DefaultController}
  18. *
  19. * @author Marc Mautz <m.mautz@herzogkommunikation.de>
  20. * @version $Id$
  21. * @package extensions.lightbox
  22. * @since 2.0
  23. */
  24. Yii::setPathOfAlias("ELightBoxWidget", dirname(__FILE__));
  25. class ELightBoxWidget extends CWidget {
  26. public $title = "LightBox Gallery";
  27. public $layout = "Link-List";
  28. public $file0;
  29. public $file1;
  30. public $file2;
  31. public $file3;
  32. public $file4;
  33. public $file5;
  34. public $file6;
  35. public $file7;
  36. public $file8;
  37. public $file9;
  38. public $fileTitle0;
  39. public $fileTitle1;
  40. public $fileTitle2;
  41. public $fileTitle3;
  42. public $fileTitle4;
  43. public $fileTitle5;
  44. public $fileTitle6;
  45. public $fileTitle7;
  46. public $fileTitle8;
  47. public $fileTitle9;
  48. protected $_uniqid;
  49. public function init() {
  50. $this->_uniqid = uniqid("ELightBoxWidget");
  51. }
  52. public function run() {
  53. $publishPath = Yii::app()->assetManager->publish(dirname(__FILE__).DS."support/");
  54. $css = $publishPath."/css/jquery.lightbox-0.5.css";
  55. Yii::app()->clientScript->registerCssFile($css);
  56. $script = "var publishPath = '".$publishPath."/';";
  57. Yii::app()->clientScript->registerScript('publishPath', $script, CClientScript::POS_END);
  58. $js = $publishPath."/js/jquery.lightbox-0.5.min.js";
  59. Yii::app()->clientScript->registerScriptFile($js, CClientScript::POS_END);
  60. $this->render(
  61. 'lightbox',
  62. array(
  63. 'title' => $this->title,
  64. 'layout' => $this->layout,
  65. 'file0' => $this->file0,
  66. 'file1' => $this->file1,
  67. 'file2' => $this->file2,
  68. 'file3' => $this->file3,
  69. 'file4' => $this->file4,
  70. 'file5' => $this->file5,
  71. 'file6' => $this->file6,
  72. 'file7' => $this->file7,
  73. 'file8' => $this->file8,
  74. 'file9' => $this->file9,
  75. 'fileTitle0' => $this->fileTitle0,
  76. 'fileTitle1' => $this->fileTitle1,
  77. 'fileTitle2' => $this->fileTitle2,
  78. 'fileTitle3' => $this->fileTitle3,
  79. 'fileTitle4' => $this->fileTitle4,
  80. 'fileTitle5' => $this->fileTitle5,
  81. 'fileTitle6' => $this->fileTitle6,
  82. 'fileTitle7' => $this->fileTitle7,
  83. 'fileTitle8' => $this->fileTitle8,
  84. 'fileTitle9' => $this->fileTitle9,
  85. )
  86. );
  87. }
  88. }