protected function _load() { $pluginName = strtolower(array_shift($this->_options)); if (!$pluginName) { return $this->_translator->translate('Plugin name not specified.'); } $plugin = Application_Model_Mappers_PluginMapper::getInstance()->findByName($pluginName); if ($plugin !== null) { if ($plugin->getStatus() != Application_Model_Models_Plugin::ENABLED) { return $this->_translator->translate('You need install the ') . $plugin->getName() . $this->_translator->translate(' plug-in to view and use this great feature.') . ' <a href="http://www.seotoaster.com/website-plugins-marketplace.html" target="_blank">' . $this->_translator->translate('Download plug-ins here') . ' ' . '</a>' . $this->_translator->translate('and watch a short video to learn how to install plug-ins on your website') . ' <a href="http://www.seotoaster.com/how-to-add-a-plugin.html" target="_blank">' . $this->_translator->translate('here') . '</a>.'; } try { $toasterPlugin = Tools_Factory_PluginFactory::createPlugin($plugin->getName(), $this->_options, $this->_toasterOptions); return $toasterPlugin->run(); } catch (Exceptions_SeotoasterPluginException $spe) { if (Tools_System_Tools::debugMode()) { error_log($spe->getMessage() . "\n" . $spe->getTraceAsString()); } if (Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_ADMINPANEL)) { return $spe->getMessage(); } } catch (Exceptions_SeotoasterException $se) { if (Tools_System_Tools::debugMode()) { error_log($se->getMessage() . "\n" . $se->getTraceAsString()); } if (Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_ADMINPANEL)) { return $se->getMessage(); } } catch (Exception $e) { if (Tools_System_Tools::debugMode()) { error_log($e->getMessage() . "\n" . $e->getTraceAsString()); } //return $e->getMessage(); } } if (Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_ADMINPANEL)) { return $this->_translator->translate('You need the') . ' ' . $pluginName . ' ' . $this->_translator->translate('plug-in to view and use this great feature.') . ' <a href="http://www.seotoaster.com/website-plugins-marketplace.html" target="_blank">' . $this->_translator->translate('Download plug-ins here') . ' ' . '</a>' . $this->_translator->translate('and watch a short video to learn how to install plug-ins on your website') . ' <a href="http://www.seotoaster.com/how-to-add-a-plugin.html" target="_blank">' . $this->_translator->translate('here') . '</a>.'; } return ''; }
protected function _load() { $pagesList = array(); $pages = Application_Model_Mappers_PageMapper::getInstance()->fetchAllMainMenuPages(); $configHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('config'); $showMemberPages = (bool) $configHelper->getConfig('memPagesInMenu'); $isAllowed = Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_PAGE_PROTECTED); $flatPages = Application_Model_Mappers_PageMapper::getInstance()->fetchAllStaticMenuPages(); $nomenuPages = Application_Model_Mappers_PageMapper::getInstance()->fetchAllNoMenuPages(); foreach ($pages as $key => $page) { if ($page['parentId'] == 0) { if ((bool) $page['protected'] && !$isAllowed && !$showMemberPages) { continue; } $pagesList[$key]['category'] = $page; foreach ($pages as $subPage) { if (isset($subPage['protected']) && (bool) $subPage['protected'] && !$isAllowed && !$showMemberPages) { continue; } if ($subPage['parentId'] == $page['id']) { $pagesList[$key]['subPages'][] = $subPage; } } } } $this->_view->pages = $pagesList; $this->_view->flatPages = $flatPages; if (isset($this->_options[0])) { if ($this->_options[0] == 'nomenuPages') { $this->_view->nomenuPages = $nomenuPages; } } $newslogPlugin = Application_Model_Mappers_PluginMapper::getInstance()->findByName('newslog'); if ($newslogPlugin instanceof Application_Model_Models_Plugin) { if ($newslogPlugin->getStatus() == Application_Model_Models_Plugin::ENABLED) { $this->_view->newsFolder = Newslog_Models_Mapper_ConfigurationMapper::getInstance()->fetchConfigParam('folder'); } } return $this->_view->render('sitemap.phtml'); }
public function fireactionAction() { $this->_helper->viewRenderer->setNoRender(true); $pluginName = $this->getRequest()->getParam('name'); //we will fire the action in the case when plugin is enabled $toasterPlugin = Application_Model_Mappers_PluginMapper::getInstance()->findByName($pluginName); if ($toasterPlugin instanceof Application_Model_Models_Plugin && $toasterPlugin->getStatus() == Application_Model_Models_Plugin::ENABLED) { $pageData = array('websiteUrl' => $this->_helper->website->getUrl()); try { $plugin = Tools_Factory_PluginFactory::createPlugin($pluginName, array(), $pageData); $plugin->run($this->getRequest()->getParams()); } catch (Exception $e) { die($e->getMessage()); } } }
public static function findPluginByName($pluginName) { $plugin = Application_Model_Mappers_PluginMapper::getInstance()->findByName($pluginName); if ($plugin instanceof Application_Model_Models_Plugin) { $plugin->setPreview(self::findPluginPreview($plugin->getName())); return $plugin; } $plugin = new Application_Model_Models_Plugin(); $plugin->setName($pluginName); try { $plugin->setPreview(self::findPluginPreview($plugin->getName())); } catch (Exceptions_SeotoasterException $se) { $plugin->setPreview(Zend_Controller_Action_HelperBroker::getStaticHelper('Website')->getUrl() . 'system/images/noimage.png'); } $plugin->setStatus(Application_Model_Models_Plugin::DISABLED); return $plugin; }
private function _getQuotePageWhere() { $quotePlugin = Application_Model_Mappers_PluginMapper::getInstance()->findByName('quote'); if ($quotePlugin !== null && $quotePlugin->getStatus() === Application_Model_Models_Plugin::ENABLED) { return 'parent_id != "' . Quote::QUOTE_CATEGORY_ID . '"'; } return null; }