コード例 #1
0
ファイル: Cms.php プロジェクト: bokultis/kardiomedika
 protected function _initApplication()
 {
     $bootstrap = $this->getInvokeArg('bootstrap');
     $config = $bootstrap->getOptions();
     if (isset($config['default']['applicationId'])) {
         $this->_applicationId = $config['default']['applicationId'];
     } else {
         $this->_applicationId = 1;
     }
     $this->_application = new Application_Model_Application();
     if (!Application_Model_ApplicationMapper::getInstance()->find($this->_applicationId, $this->_application)) {
         throw new Zend_Exception("Application not found [{$this->_applicationId}]");
     }
     $this->_publicDirectory = isset($config['default']['publicDirectory']) ? $config['default']['publicDirectory'] : APPLICATION_PATH . '/../public';
     $fileConfig = HCMS_Utils::loadThemeConfig('application.php');
     if ($fileConfig && isset($fileConfig['settings'])) {
         $this->_application->set_settings($fileConfig['settings']);
     }
     $this->view->application = $this->_application;
     $this->view->headTitle($this->_application->get_name())->setSeparator(' - ');
     if ($this->getRequest()->getModuleName() != '') {
         $this->_module = $this->getRequest()->getModuleName();
     }
     $this->view->module = $this->_module;
     //fb og properies
     $this->view->doctype('XHTML1_RDFA');
     $this->view->headMeta()->setProperty('og:type', 'website');
     $this->view->headMeta()->setProperty('og:url', $this->view->fullUrl());
     if ($this->_application->get_name() != '') {
         $this->view->headMeta()->setProperty('og:title', $this->_application->get_name());
     }
     if ($this->_application->get_og_settings('image') != '') {
         $this->view->headMeta()->setProperty('og:image', $this->view->fullUrl('/content/1/' . $this->_application->get_og_settings('image')));
     }
     if ($this->_application->get_og_settings('description') != '') {
         $this->view->headMeta()->setProperty('og:description', $this->_application->get_og_settings('description'));
     }
 }