Example #1
0
 function indexAction()
 {
     $config_table = new Config();
     $modules_table = new Modules("core");
     $request = new Bolts_Request($this->getRequest());
     if ($request->has('modid')) {
         $modid = $request->modid;
     } else {
         $modid = 'bolts';
     }
     if ($this->_request->isPost()) {
         //we are posting
         $config_params = $this->_request->getParams();
         foreach ($config_params as $ckey => $value) {
             $data = array('value' => $value);
             $config_table->update($data, "ckey = '" . $ckey . "' and module='" . $modid . "'");
         }
         $this->view->success = $this->_T('Configuration Updated.');
         $config_table->cache();
         $params = array();
         $this->_Bolts_plugin->doAction($this->_mca . '_post_save', $params);
         // ACTION HOOK
     }
     $config = $config_table->fetchAll($config_table->select()->where('module = ?', $modid));
     if (count($config) > 0) {
         $config = $config->toArray();
         sort($config);
         $this->view->config = $config;
     }
     $modules = $modules_table->getEnabledModules();
     sort($modules);
     $this->view->modules = $modules;
     $this->view->current = $modid;
     $this->view->modid = $modid;
 }
Example #2
0
 public function indexAction()
 {
     $request = $this->getRequest();
     $model = new Config();
     $select = $model->select()->where('ghost = false');
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('config_name');
 }
Example #3
0
	function indexAction()
	{
		$config_table = new Config();
		// $modules_table = new Modules('core');
		$modules_table = new Modules('modules');
		$modules_table_core = new Modules('core');
		$request = new RivetyCore_Request($this->getRequest());
		$modid = $request->has('modid') ? $request->modid : 'default';
		if ($this->_request->isPost())
		{
			$config_params = $this->_request->getParams();
			foreach ($config_params as $ckey => $value)
			{
				$data = array('value' => $value);
				$config_table->update($data, "ckey = '" . $ckey . "' and module = '" . $modid . "'");
			}
			$this->view->success = $this->_T('Configuration Updated.');
			$config_table->cache();
			$params = array();
			$this->_rivety_plugin->doAction($this->_mca . '_post_save', $params); // ACTION HOOK
		}
		$config = $config_table->fetchAll($config_table->select()->where('module = ?', $modid));
		if (count($config) > 0)
		{
			$config = $config->toArray();
			sort($config);
			$this->view->config = $config;
		}
		$modules = $modules_table_core->getEnabledModules();
		sort($modules);
		$this->view->modules = $modules;
		$this->view->current = $modid;
		$this->view->modid = $modid;
		if ($modid == 'default') $mod_cfg = $modules_table_core->parseIni($modid);
		else $mod_cfg = $modules_table->parseIni($modid);
		$this->view->module_title = $mod_cfg['general']['name'];
		$this->view->breadcrumbs = array('Module Config' => null);
	}