public function render_item($match){
		$return = '';
		ob_start();
		$chronoconnectivity5_setup = function() use($match){
			$mainframe = \JFactory::getApplication();
			parse_str($match, $params);
			foreach($params as $pk => $pv){
				\GCore\Libs\Request::set($pk, $pv);
			}
			$params_keys = array_keys($params);
			$ccname = $params_keys[0];
			$connection = GCore\Libs\Request::data('ccname', '');
			$act = GCore\Libs\Request::data('act', '');
			if(!empty($act)){
				if($ccname != $connection){
					$act = '';
				}
			}
			return array('ccname' => $ccname);
		};

		$output = new JoomlaGCLoader('front', 'chronoconnectivity5', 'chronoconnectivity', $chronoconnectivity5_setup, array('controller' => 'lists', 'action' => ''));
		$return = ob_get_clean();
		return $return;
	}
Example #2
0
 public static function check($field = 'captcha', $key = 'gcore_captcha')
 {
     $posvar = \GCore\Libs\Request::data($field, null);
     if (!empty($posvar)) {
         $session = \GCore\Libs\Base::getSession();
         $sessionvar = $session->get($key);
         $postvar = strtolower($posvar);
         if (md5($postvar) != $sessionvar) {
             \GCore\Libs\Request::set($field, '');
             return false;
         } else {
             $session->clear($key);
             \GCore\Libs\Request::set($field, '');
             return true;
         }
     } else {
         return false;
     }
 }
Example #3
0
 function index()
 {
     if (!empty($this->pmodel)) {
         $session = \GCore\Libs\Base::getSession();
         $sessioned_string = trim($this->connection['Connection']['extras'][$this->area]['columns']['sessioned']);
         if (!empty($sessioned_string)) {
             $columns = explode("\n", $sessioned_string);
             $fields = array_map('trim', $columns);
             foreach ($fields as $k => $field) {
                 $value = \GCore\Libs\Request::data($field, null);
                 if (!is_null($value)) {
                     $session->set($field, $value);
                 } else {
                     \GCore\Libs\Request::set($field, $session->get($field));
                     $this->data[$field] = $session->get($field);
                 }
             }
         }
         $find_params = array();
         $conditions = eval('?>' . $this->connection['Connection']['extras']['models']['conditions'][1]);
         $this->pmodel->conditions = is_array($conditions) ? $conditions : array();
         if (!empty($this->connection['Connection']['extras']['models']['fields'][1])) {
             $find_params['fields'] = $this->_process_fields_list($this->connection['Connection']['extras']['models']['fields'][1]);
         }
         if (!empty($this->connection['Connection']['extras']['models']['order'][1])) {
             $this->pmodel->order_by = $this->_process_fields_list($this->connection['Connection']['extras']['models']['order'][1]);
         }
         if (!empty($this->connection['Connection']['extras']['models']['group'][1])) {
             //$find_params['group'] = array_map('trim', explode(',', $this->connection['Connection']['extras']['models']['group'][1]));
             $this->pmodel->group = $this->_process_fields_list($this->connection['Connection']['extras']['models']['group'][1]);
         }
         //sorting
         $this->sort_model = $this->pmodel;
         $this->_sortable();
         //filtering
         $this->filter_model = $this->pmodel;
         $_f = function ($e) {
             $cs = explode(':', $e, 2);
             return trim($cs[0]);
         };
         //filters
         $filters_fields = array();
         $filters_string = trim($this->connection['Connection']['extras'][$this->area]['columns']['filters']);
         if (!empty($filters_string)) {
             $columns = explode("\n", $filters_string);
             $filters_fields = array_map($_f, $columns);
         }
         $this->_filter($filters_fields);
         //search
         $this->search_model = $this->pmodel;
         $searchable_fields = array();
         $searchable_string = trim($this->connection['Connection']['extras'][$this->area]['columns']['searchable']);
         if (!empty($searchable_string)) {
             $columns = explode("\n", $searchable_string);
             $searchable_fields = array_map($_f, $columns);
         }
         $this->_search($searchable_fields);
         //paginating
         $this->paginate_model = $this->pmodel;
         $this->_paginate();
         //find records list
         $rows = $this->pmodel->find('all', $find_params);
         //pr($rows);
         $this->set('rows', $rows);
         $this->set('connection', $this->connection);
         $this->set('area', $this->area);
         //add the correct display helper
         $helper = $this->connection['Connection']['extras'][$this->area]['display']['block'];
         $this->helpers[] = '\\GCore\\Admin\\Extensions\\Chronoconnectivity\\Blocks\\' . \GCore\Libs\Str::camilize($helper);
         $this->set('helper', \GCore\Libs\Str::camilize($helper));
         $this->view = \GCore\C::ext_path('chronoconnectivity', 'admin') . 'views' . DS . 'lists' . DS . 'index.php';
     }
 }