コード例 #1
0
ファイル: CmsPage.php プロジェクト: TiMESPLiNTER/meta-cms
 /**
  * Renders the page with a specific view
  *
  * @param FrontendController $frontendController
  * @param CmsView $view
  * @throws CMSException
  * @return string The rendered html
  */
 public function render(FrontendController $frontendController, CmsView $view)
 {
     if ($this->layout === null && $this->layoutID !== null) {
         throw new CMSException('Modules not loaded for page #' . $this->ID);
     }
     return $this->layout !== null ? $this->layout->render($frontendController, $view) : null;
 }
コード例 #2
0
 public function create(DB $db)
 {
     try {
         parent::create($db);
     } catch (\Exception $e) {
         return false;
     }
     return true;
 }
コード例 #3
0
 public function create(DB $db)
 {
     try {
         parent::create($db);
         $stmntInsert = $db->prepare("\n\t\t\t\tINSERT mod_border_layout SET\n\t\t\t\t\tmod_instance_IDFK = ?,\n\t\t\t\t\tpage_IDFK = ?,\n\t\t\t\t\teast_grid_size = ?,\n\t\t\t\t\tcenter_grid_size = ?,\n\t\t\t\t\twest_grid_size = ?,\n\t\t\t\t\tnorth_mod_IDFK = ?,\n\t\t\t\t\tsouth_mod_IDFK = ?,\n\t\t\t\t\teast_mod_IDFK = ?,\n\t\t\t\t\twest_mod_IDFK = ?,\n\t\t\t\t\tcenter_mod_IDFK = ?\n\t\t\t");
         $db->insert($stmntInsert, array($this->ID, $this->pageID, $this->settings->east_grid_size, $this->settings->center_grid_size, $this->settings->west_grid_size, $this->settings->north_mod_IDFK, $this->settings->south_mod_IDFK, $this->settings->east_mod_IDFK, $this->settings->west_mod_IDFK, $this->settings->center_mod_IDFK));
     } catch (\Exception $e) {
         return false;
     }
     return true;
 }
コード例 #4
0
 /**
  * @param string $dropZoneID
  * @param LayoutElement $parentElement
  * @param CmsElement $newElement
  *
  * @return bool
  * @throws CMSException
  */
 protected function isAllowedElement($dropZoneID, LayoutElement $parentElement, CmsElement $newElement)
 {
     $dropZoneRestrictions = $parentElement->getDropzone($dropZoneID);
     if ($dropZoneRestrictions === null) {
         return true;
     }
     $countWhiteList = count($dropZoneRestrictions['whitelist']);
     $countBlackList = count($dropZoneRestrictions['blacklist']);
     if ($countWhiteList === 0 && $countBlackList === 0) {
         return true;
     }
     if ($countWhiteList > 0 && $countBlackList > 0) {
         throw new CMSException('You can not specify a black and a white list at the same time for the same dropzone (' . $dropZoneID . ')');
     }
     if ($countWhiteList > 0) {
         return in_array(get_class($newElement), $dropZoneRestrictions['whitelist']);
     }
     if ($countBlackList > 0) {
         return !in_array(get_class($newElement), $dropZoneRestrictions['blacklist']);
     }
     return true;
 }
コード例 #5
0
 public function __construct($ID, $pageID)
 {
     parent::__construct($ID, $pageID, 'element_column_layout');
     $this->logger = FrameworkLoggerFactory::getLogger($this);
 }