/** * Creates the main admin page and saves the data if submitted * * @return null * @added 1.0 */ static function adminPage() { if (RM_Input::post('RMExport')) { RM_Export::export(); } if (RM_Input::post('RMSubmit') || RM_Input::post('RMImport') || RM_Input::post('RMReset')) { $data = RM_Input::post('RMImport') ? RM_Import::getData(RM_Input::file('RMImportFile')) : RM_Input::post(); /* Reset to defaults */ if (RM_Input::post('RMReset')) { $data = RM_Registry::get('defaults'); $data['RMArShpA'] = json_decode($data['RMArShpA']); $data['RMArShpI'] = json_decode($data['RMArShpI']); } RM_AdminModel::save($data); if (ResponsiveMenu::getOption('RMExternal')) { RM_FolderModel::create(); $js = RM_JSModel::getJs(ResponsiveMenu::getOptions()); $js = ResponsiveMenu::getOption('RMMinify') == 'minify' ? RM_JSModel::Minify($js) : ($js = $js); RM_JSModel::createJSFile($js); $css = RM_CSSModel::getCSS(ResponsiveMenu::getOptions()); $css = ResponsiveMenu::getOption('RMMinify') == 'minify' ? RM_JSModel::Minify($css) : ($css = $css); RM_CSSModel::createCSSFile($css); } } RM_View::make('admin.page', ResponsiveMenu::getOptions()); }
/** * Creates the view for the menu and echos it out * * @return string * @added 1.0 */ static function display($args = null) { /* Unfortunately this messy section is due to shortcodes converting all args to lowercase */ if ($args) { if ($args['rm']) { $args['RM'] = $args['rm']; } } RM_View::make('menu', $args ? array_merge(ResponsiveMenu::getOptions(), $args) : ResponsiveMenu::getOptions()); }
/** * Creates the view for the menu and echos it out * * @return string * @added 1.0 */ static function display($args = null) { /* Unfortunately this messy section is due to shortcodes converting all args to lowercase */ if ($args) { if ($args['rm']) { $args['RM'] = $args['rm']; } if ($args['menu']) { $args['RM'] = $args['menu']; } if ($args['title']) { $args['RMTitle'] = $args['title']; } if ($args['title_link']) { $args['RMTitleLink'] = $args['title_link']; } if ($args['title_open']) { $args['RMTitleLoc'] = $args['title_open']; } if ($args['html']) { $args['RMHtml'] = $args['html']; } if ($args['html_loc']) { $args['RMHtmlLoc'] = $args['html_loc']; } if ($args['title_img']) { $args['RMImage'] = $args['title_img']; } if ($args['search_loc']) { $args['RMSearchPos'] = $args['search_loc']; } if ($args['btn_img']) { $args['RMClickImg'] = $args['btn_img']; } if ($args['btn_img_clicked']) { $args['RMClickImgClicked'] = $args['btn_img_clicked']; } if ($args['btn_title']) { $args['RMClickTitle'] = $args['btn_title']; } } $options = ResponsiveMenu::getOptions(); RM_View::make('menu', $args ? array_merge($options, $args) : $options); RM_View::make('click-button', $args ? array_merge($options, $args) : $options); }
public function dispatch() { $rootPath = $this->_rootPath; $modulesDAO = new RM_Modules(); $modules = $modulesDAO->fetchAll(); $pluginsDAO = new RM_Plugins(); $plugins = $pluginsDAO->fetchAll(); $frontController = Zend_Controller_Front::getInstance(); $frontController->setDispatcher($this->getDispatcher()); $frontController->registerPlugin(new Zend_Controller_Plugin_ErrorHandler(array('module' => $this->getModule(), 'controller' => 'Error', 'action' => 'error'))); $frontController->setDefaultModule($this->_module); $frontController->throwExceptions(false); $controllerPathes = array('admin' => array(), 'user' => array()); $coreControllers = implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'system', 'application', 'controllers')) . DIRECTORY_SEPARATOR; $controllerPathes['admin'][] = $coreControllers; $controllerPathes['user'][] = $coreControllers; foreach ($modules as $module) { $controllerPathes['admin'][] = $controllerPathes['user'][] = RM_Module_Manager::getModuleFolderpath($module->name, $this->_rootPath) . DIRECTORY_SEPARATOR . RM_Module_Config::CONTROLLERS; } foreach ($plugins as $plugin) { $controllerPathes['admin'][] = $controllerPathes['user'][] = RM_Plugin_Manager::getPluginFolderpath($plugin->name, $this->_rootPath) . DIRECTORY_SEPARATOR . RM_Plugin_Config::CONTROLLERS; } $frontController->setControllerDirectory($controllerPathes); $scriptPathes = array(); foreach ($modules as $module) { $scriptPathes[] = implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'userdata', 'modules', $module->name, RM_Module_Config::VIEWS, 'admin', 'scripts')) . DIRECTORY_SEPARATOR; $scriptPathes[] = implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'userdata', 'modules', $module->name, RM_Module_Config::VIEWS, 'user', 'scripts')) . DIRECTORY_SEPARATOR; } foreach ($plugins as $plugin) { $scriptPathes[] = implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'userdata', 'plugins', $plugin->name, RM_Plugin_Config::VIEWS, 'admin', 'scripts')) . DIRECTORY_SEPARATOR; $scriptPathes[] = implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'userdata', 'plugins', $plugin->name, RM_Plugin_Config::VIEWS, 'user', 'scripts')) . DIRECTORY_SEPARATOR; } $scriptPathes[] = implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'userdata', 'views', 'admin', 'scripts')) . DIRECTORY_SEPARATOR; $scriptPathes[] = implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'userdata', 'views', 'user', 'scripts')) . DIRECTORY_SEPARATOR; $view = new RM_View(); $view->addScriptPath($scriptPathes); $viewRenderer = new RM_Controller_Action_Helper_ViewRenderer($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); $router = RM_Environment::getInstance()->getRouter(); $frontController->setRouter($router); Zend_Layout::startMvc(array('layout' => $this->_module, 'layoutPath' => implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'userdata', 'layouts')))); $model = new RM_Modules(); $modules = $model->fetchAllEnabled(); $manager = new RM_Module_Manager(); foreach ($modules as $module) { $moduleObject = $manager->getModule($module->name); if ($moduleObject instanceof RM_System_Setup) { $moduleObject->preDispatch(); } } $frontController->dispatch($this->getRequestHTTP()); }
function parse($iso, $information) { $view = new RM_View(); $view->assign('information', $information); return $view->render('templates/invoice.phtml'); }
/** * Get all form panels returns JSON with title and link to JS * */ public function helppageAction() { ob_clean(); $view = new RM_View(); $view->addScriptPath(implode(DIRECTORY_SEPARATOR, array(RM_Environment::getConnector()->getRootPath(), 'RM', 'userdata', 'modules', 'FormDesigner', 'views', 'admin', 'scripts', 'FormDesigner'))); echo $view->render('help.phtml'); die; }