Guest User

Untitled

a guest
Jul 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. <?php
  2.  
  3. defined('C5_EXECUTE') or die(_("Access Denied."));
  4.  
  5.  
  6. //installation of theme
  7. class Theme3in1Package extends Package {
  8.  
  9. protected $pkgHandle = 'theme_3in1';
  10. protected $appVersionRequired = '5.3.0';
  11. protected $pkgVersion = '3.0';
  12.  
  13. public function getPackageDescription() {
  14. return t("3in1 Theme, Backdrop Block, Growl Block");
  15. }
  16.  
  17. public function getPackageName() {
  18. return t("3in1");
  19. }
  20.  
  21. public function install() {
  22. $pkg = parent::install();
  23. PageTheme::add('3in1', $pkg);
  24. }
  25.  
  26.  
  27.  
  28. }
  29.  
  30.  
  31.  
  32. //installation of backdrop package
  33.  
  34. class BackdropPackage extends Package {
  35.  
  36. protected $pkgHandle = 'Backdrop';
  37. protected $appVersionRequired = '5.3.0';
  38. protected $pkgVersion = '1.0';
  39.  
  40. public function getPackageName() {
  41. return t("Backdrop");
  42. }
  43.  
  44. public function getPackageDescription() {
  45. return t("A Jquery pull down to show hidden content.");
  46. }
  47.  
  48. public function install() {
  49. $pkg = parent::install();
  50. BlockType::installBlockTypeFromPackage('Backdrop', $pkg);
  51. }
  52.  
  53. }
  54.  
  55.  
  56. //installation of growl package
  57.  
  58.  
  59. class GrowlBlockController extends BlockController {
  60.  
  61. //var $pobj;
  62.  
  63. protected $btDescription = "Growl style block";
  64. protected $btName = "Growl";
  65. protected $btTable = 'btGrowl';
  66. protected $btInterfaceWidth = "350";
  67. protected $btInterfaceHeight = "300";
  68.  
  69. protected $pkgHandle = 'Growl';
  70. protected $appVersionRequired = '5.3.0';
  71. protected $pkgVersion = '1.0';
  72.  
  73. public function getPackageName() {
  74. return t("Growl");
  75. }
  76.  
  77. public function getPackageDescription() {
  78. return t("A Jquery notification.");
  79. }
  80.  
  81. public function install() {
  82. $pkg = parent::install();
  83. BlockType::installBlockTypeFromPackage('Growl', $pkg);
  84. }
  85.  
  86. function getFileID() {return $this->file;}
  87. function getFileOnstateID() {return $this->fOnstateID;}
  88. function getFileOnstateObject() {
  89. if ($this->fOnstateID > 0) {
  90. return File::getByID($this->fOnstateID);
  91. }
  92. }
  93. function getFileObject() {
  94. return File::getByID($this->file);
  95. }
  96.  
  97.  
  98. public function on_page_view(){
  99. $html = Loader::helper('html');
  100.  
  101. $v = View::GetInstance();
  102.  
  103. $b = $this->getBlockObject();
  104. $btID = $b->getBlockTypeID();
  105. $bt = BlockType::getByID($btID);
  106.  
  107. $uh = Loader::helper('concrete/urls');
  108.  
  109. $v->addHeaderItem('<script type="text/javascript" src="' . $uh->getBlockTypeAssetsURL($bt) . '/lewis-growl.js"></script>','CONTROLLER');
  110. $v->addHeaderItem('<link rel="stylesheet" type="text/css" href="' . $uh->getBlockTypeAssetsURL($bt) . '/lewis-growl.css" />','CONTROLLER');
  111.  
  112. }
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. }
Add Comment
Please, Sign In to add comment