protected function _buildQueryWhere(KDatabaseQuery $query) { $state = $this->getState(); if ($state->search) { $search = '%' . $state->search . '%'; $query->where('tbl.target_type', 'LIKE', $search); $query->where('tbl.text', 'LIKE', $search, 'OR'); } if ($state->controller) { $query->where('tbl.controller', '=', $state->controller); } if ($state->browse) { $query->where('tbl.browse', '=', 1); } if ($state->read) { $query->where('tbl.read', '=', 1); } if ($state->edit) { $query->where('tbl.edit', '=', 1); } if ($state->add) { $query->where('tbl.add', '=', 1); } if ($state->delete) { $query->where('tbl.delete', '=', 1); } parent::_buildQueryWhere($query); }
public function __construct($options = array()) { parent::__construct($options); $this->setState('find_properties_by', KInput::get('find_properties_by', 'get', 'string')); $this->setState('type_id', KInput::get('type_id', 'get', 'int')); $this->setState('id', KInput::get('id', 'get', 'int')); }
protected function _buildQueryWhere(KDatabaseQuery $query) { parent::_buildQueryWhere($query); $state = $this->getState(); if ($state->service) { $query->where('service', '=', $state->service); } if ($state->oauth_token) { $query->where('oauth_token', '=', $state->oauth_token); } if ($state->oauth_token_secret) { $query->where('oauth_token_secret', '=', $state->oauth_token_secret); } if ($state->service_username) { $query->where('service_username', '=', $state->service_username); } if ($state->service_id) { $query->where('service_id', '=', $state->service_id); } if ($state->service_avatar) { $query->where('service_avatar', '=', $state->service_avatar); } if ($state->userid) { $query->where('userid', '=', $state->userid); } if ($state->created_by) { $query->where('created_by', '=', $state->created_by); } }
/** * Builds a WHERE clause for the query. * * @param KDatabaseQuery A query object. * @return void */ protected function _buildQueryWhere(KDatabaseQuery $query) { parent::_buildQueryWhere($query); if ($this->_state->username) { $query->where('username', 'IN', $this->_state->username); } }
public function __construct($options = array()) { parent::__construct($options); $this->setState('album', KInput::get('album', 'get', 'string')); $this->setState('id', KInput::get('id', 'get', 'int')); JPluginHelper::importPlugin('gdata', 'gdata'); }
public function getFilters() { $filter = parent::getFilters(); $filter['purpose_id'] = KInput::get('filter_purpose_id', 'post', 'int'); $filter['project_id'] = KInput::get('filter_project_id', 'post', 'int', '', -1); $filter['state'] = KInput::get('filter_state', 'post', 'string'); $filter['search'] = KInput::get('search', 'post', 'string'); return $filter; }
/** * Adds an 'primary' flag to the language objects */ public function getList() { $languages = parent::getList(); $primary = KFactory::get('admin::com.nooku.model.nooku')->getPrimaryLanguage()->iso_code; foreach ($languages as $lang) { $lang->primary = $lang->iso_code == $primary; } return $languages; }
public function getFilters() { $filter = parent::getFilters(); $filter['tag_id'] = KInput::get('filter_tag_id', 'post', 'int'); $filter['category_id'] = KInput::get('filter_category_id', 'post', 'int'); $filter['state'] = KInput::get('filter_state', 'post', 'string'); $filter['search'] = KInput::get('search', 'post', 'string'); return $filter; }
public function __construct($options = array()) { parent::__construct($options); $array = JRequest::getVar('id', array(0), '', 'array'); $edit = JRequest::getVar('edit', true); if ($edit) { $this->setId((int) $array[0]); } }
public function getDefaultState() { $state = parent::getDefaultState(); $state['user_id'] = KInput::get('user_id', 'get', 'int', null, 0); $state['year'] = KInput::get('year', 'get', 'int', null, date('Y')); $state['month'] = KInput::get('month', 'get', 'digit', null, date('m')); $state['table_name'] = KInput::get('table_name', 'get', KFactory::tmp('admin::com.nooku.filter.tablename'), null, ''); return $state; }
protected function _buildQueryWhere(KDatabaseQuery $query) { $state = $this->getState(); if ($state->search) { $search = '%' . $state->search . '%'; $query->where('tbl.title', 'LIKE', $search); $query->where('tbl.text', 'LIKE', $search, 'OR'); } parent::_buildQueryWhere($query); }
public function getList() { $list = parent::getList(); // Add table comment information $tables = $this->getTableList(); foreach ($list as $item) { $item->comment = $tables[$item->table_name]->comment; } return $list; }
public function getDefaultState() { $app = KFactory::get('lib.joomla.application'); $ns = $this->getClassName('prefix') . '.' . $this->getClassName('suffix'); $state = parent::getDefaultState(); $state['filter_table_name'] = $app->getUserStateFromRequest($ns . 'table_name', 'filter_table_name', '', 'word'); $state['filter_iso_code'] = $app->getUserStateFromRequest($ns . 'iso_code', 'filter_iso_code', '', 'cmd'); $state['filter_status'] = $app->getUserStateFromRequest($ns . 'status', 'filter_status', '', 'int'); $state['filter_translator'] = $app->getUserStateFromRequest($ns . 'translator', 'filter_translator', 0, 'int'); return $state; }
public function __construct($options = array()) { parent::__construct($options); // set our own defaults, this list requires no pagination or custom sorting //$this->setState('limit', 0); //$this->setState('limitstart', 0); $this->setState('order', 'tbl.tag'); $this->setState('direction', 'ASC'); $this->setState('picman_tag_id', JRequest::getInt('picman_tag_id', null)); $this->setState('picman_album_id', JRequest::getInt('picman_album_id', null)); }
protected function _buildQueryWhere(KDatabaseQuery $query) { parent::_buildQueryWhere($query); $state = $this->getState(); if ($state->target_type) { $query->where('target_type', '=', $state->target_type); } if ($state->target_id) { $query->where('target_id', '=', $state->target_id); } }
protected function _buildQueryWhere(KDatabaseQuery $query) { parent::_buildQueryWhere($query); $state = $this->getState(); if ($state->blog_blog_id) { $query->where('blog_blog_id', '=', $state->blog_blog_id); } if ($state->enabled) { $query->where('enabled', '=', $state->enabled); } }
protected function _buildQueryWhere(KDatabaseQuery $query) { $state = $this->_state; if (is_bool($state->enabled)) { $query->where('tbl.published', '=', (int) $state->enabled); } if (is_numeric($state->category) && !empty($state->category)) { $query->where('tbl.catid', '=', $state->category); } if ($state->search) { $query->where('tbl.name', 'LIKE', '%' . $state->search . '%'); } parent::_buildQueryWhere($query); }
/** * Order the activities in reverse cronological order */ protected function _buildQueryWhere(KDatabaseQuery $query) { parent::_buildQueryWhere($query); $query->select('controllers.controller, targets.title AS stream_target'); $query->join('LEFT', 'stream_controllers AS controllers', 'controllers.stream_controller_id = tbl.stream_controller_id'); $query->join('LEFT', 'stream_targets AS targets', 'targets.stream_target_id = controllers.stream_target_id'); $query->order('created_on', 'DESC'); $state = $this->getState(); if ($state->parent_target_id) { $query->where('tbl.parent_target_id', '=', $state->parent_target_id); } if ($state->userid) { } }
public function getList() { if (!isset($this->_list)) { $list = parent::getList(); //Get the menu item data from all the languages $menu = KFactory::get('lib.joomla.application')->getMenu(); $user = KFactory::get('lib.joomla.user'); $nooku = KFactory::get('admin::com.nooku.model.nooku'); $primary = $nooku->getPrimaryLanguage()->iso_code; //If an active menu item can be found use it to get all relevant menu item data on all languages if ($item = $menu->getActive()) { $query = $this->_db->getQuery()->select($primary . '.published AS ' . $primary . '_published')->select($primary . '.access AS ' . $primary . '_access')->from('menu AS ' . $primary)->where($primary . '.id', '=', $item->id); foreach ($list as $lang) { if ($lang->iso_code != $primary) { $query->join('LEFT', strtolower($lang->iso_code) . '_menu AS ' . $lang->iso_code, $primary . '.id = ' . $lang->iso_code . '.id')->select($lang->iso_code . '.published AS ' . $lang->iso_code . '_published')->select($lang->iso_code . '.access AS ' . $lang->iso_code . '_access'); } } //Turn query translations off $active = $this->_db->setActiveLanguage(); $this->_db->select($query); $result = $this->_db->loadAssoc(); //Turn query translations on $this->_db->setActiveLanguage($active); //Decide based on publish and access information which items to return foreach ($list as $item) { if ($result[$item->iso_code . '_published'] == 0 || $result[$item->iso_code . '_access'] > $user->aid) { $list->offsetUnset($list->key()); } } } foreach ($list as $item) { $item->fullname = $item->name . ' (' . $item->native_name . ')'; } } return $this->_list; }
public function __construct($options = array()) { parent::__construct($options); $this->setState('filter_state', KInput::get('filter_state', 'post', 'string')); }
protected function _buildQueryOrder(KDatabaseQuery $query) { parent::_buildQueryOrder($query); $query->order(array('tbl.parent', 'tbl.ordering')); }
public function __construct($options = array()) { parent::__construct($options); }
public function __construct(KConfig $config) { $config['table_behaviors'] = array('creatable'); parent::__construct($config); }
public function __construct($options = array()) { parent::__construct($options); $this->setState('tag_id', KInput::get('tag_id', 'get', 'int')); }
public function getDefaultState() { $state = parent::getDefaultState(); $state['source_lang'] = KInput::get('source_lang', 'get', 'lang'); return $state; }
protected function _buildQueryWhere(KDatabaseQuery $query) { parent::_buildQueryWhere($query); $query->where('enabled', '=', 1); }