예제 #1
0
파일: AController.php 프로젝트: kingsj/core
 /**
  * Return Viewer object
  *
  * @return \XLite\View\Controller
  */
 public function getViewer()
 {
     $viewer = parent::getViewer();
     if ($this->isAJAXViewer() && \XLite\Core\Request::getInstance()->widgetConfId && \XLite\Module\CDev\DrupalConnector\Handler::isCMSStarted()) {
         $data = \XLite\Module\CDev\DrupalConnector\Drupal\Model::getInstance()->getBlock(\XLite\Core\Request::getInstance()->widgetConfId);
         if ($data && isset($data['options']) && is_array($data['options'])) {
             $viewer->setWidgetParams($data['options']);
         }
     }
     return $viewer;
 }
예제 #2
0
파일: Block.php 프로젝트: kingsj/core
 /**
  * Get block content from LC (if needed)
  *
  * @param array     &$data An array of data, as returned from the hook_block_view()
  * @param \stdClass $block The block object, as loaded from the database
  *
  * @return boolean
  */
 public function setBlockContent(array &$data, \stdClass $block)
 {
     // Check if current block is an LC one
     $blockInfo = \XLite\Module\CDev\DrupalConnector\Drupal\Model::getInstance()->getBlock($block->delta);
     if ('block' == $block->module && $blockInfo) {
         // Trying to get widget from LC
         $widget = $this->getHandler()->getWidget($blockInfo['lc_class'], $blockInfo['options']);
         if ($widget) {
             // Check if widget is visible and its content is not empty
             $data['content'] = $widget->checkVisibility() && ($content = $widget->getContent()) ? $content : null;
         }
     }
     return true;
 }
예제 #3
0
파일: Admin.php 프로젝트: kingsj/core
 /**
  * Return block description
  *
  * @param integer $delta Block ID
  *
  * @return array
  */
 protected function getBlock($delta)
 {
     return \XLite\Module\CDev\DrupalConnector\Drupal\Model::getInstance()->getBlock($delta);
 }