function display($tpl = null) { // Load the helper(s) if (!class_exists('VmHTML')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php'; } // $this->assignRef('perms', Permissions::getInstance()); $model = VmModel::getModel(); $layoutName = JRequest::getWord('layout', 'default'); if ($layoutName == 'edit') { $shoppergroup = $model->getShopperGroup(); $this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name); $vendors = ShopFunctions::renderVendorList($shoppergroup->virtuemart_vendor_id); $this->assignRef('vendorList', $vendors); $this->assignRef('shoppergroup', $shoppergroup); $this->addStandardEditViewCommands(); } else { $this->SetViewTitle(); JToolBarHelper::makeDefault(); $this->loadHelper('permissions'); $showVendors = Permissions::getInstance()->check('admin'); $this->assignRef('showVendors', $showVendors); $this->addStandardDefaultViewCommands(); $this->addStandardDefaultViewLists($model); $shoppergroups = $model->getShopperGroups(false, true); $this->assignRef('shoppergroups', $shoppergroups); $pagination = $model->getPagination(); $this->assignRef('pagination', $pagination); } parent::display($tpl); }
function display($tpl = null) { $document = JFactory::getDocument(); $document->addStyleSheet('components/com_mijopolls/assets/css/mijopolls.css'); $title = $this->get('Title'); $t_title = $title ? JText::_('COM_MIJOPOLLS_VOTES_FOR') . ': ' . $title : JText::_('COM_MIJOPOLLS_SELECT_POLL'); JToolBarHelper::title($t_title, 'mijopolls'); JToolBarHelper::deleteList(JText::_('COM_MIJOPOLLS_DELETE_CONFIRM'), "deleteVotes", JText::_('COM_MIJOPOLLS_DELETE'), true); JToolBarHelper::divider(); JToolBarHelper::preferences('com_mijopolls', 500); $this->mainframe = JFactory::getApplication(); $this->option = JRequest::getWord('option'); $filter_order = $this->mainframe->getUserStateFromRequest($this->option . '.votes.filter_order', 'filter_order', 'v.date', 'cmd'); $filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . '.votes.filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $this->mainframe->getUserStateFromRequest($this->option . '.votes.search', 'search', '', 'string'); // Get data from the model $lists = $this->get('List'); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; $this->title = $title; $this->lists = $lists; $this->votes = $this->get('Data'); $this->pagination = $this->get('Pagination'); $this->poll_id = JRequest::getInt('id', 0); parent::display($tpl); }
function display($tpl = null) { $db = JFactory::getDBO(); $client = JRequest::getWord('client', 'admin'); $model = $this->getModel(); $this->document->setTitle(WFText::_('WF_PREFERENCES_TITLE')); $this->document->addStyleSheet('templates/system/css/system.css'); $component = WFExtensionHelper::getComponent(); $xml = JPATH_COMPONENT . '/models/preferences.xml'; // get params definitions $params = new WFParameter($component->params, $xml, 'preferences'); $params->addElementPath(JPATH_COMPONENT . '/elements'); if (WFModel::authorize('admin')) { $form = $model->getForm('permissions'); } else { $form = null; } $this->assign('params', $params); $this->assign('permissons', $form); $this->addStyleSheet('components/com_jce/media/css/preferences.css'); $this->addScript('components/com_jce/media/js/preferences.js'); if (JRequest::getInt('close') == 1) { $this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.close();});'); } else { $this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.init();});'); } parent::display($tpl); }
function display($tpl = null) { $language = JFactory::getLanguage(); $language->load('plg_editors_jce', JPATH_ADMINISTRATOR); $client = JRequest::getWord('client', 'site'); $model = $this->getModel(); $plugin = WFExtensionHelper::getPlugin(); $xml = WF_EDITOR_LIBRARIES . '/xml/config/editor.xml'; $data = null; // get params from editor plugin if ($plugin->params && $plugin->params !== "{}") { $data = json_decode($plugin->params); } else { $component = WFExtensionHelper::getComponent(); // get params from component "params" field (legacy) if ($component->params) { $data = json_decode($component->params); } } // get params definitions $params = new WFParameter($data, $xml, 'editor'); $params->addElementPath(JPATH_COMPONENT . '/elements'); $this->assign('model', $model); $this->assign('params', $params); $this->assign('client', $client); WFToolbarHelper::apply(); WFToolbarHelper::save(); WFToolbarHelper::help('config.about'); parent::display($tpl); }
/** * Method to display a view. * * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { // Get the current URI to redirect to. $uri = JURI::getInstance(); $redirect = base64_encode($uri); // Get the document object. $document = JFactory::getDocument(); // Set the default view name and format from the Request. if (file_exists(JPATH_CONFIGURATION . '/configuration.php') && filesize(JPATH_CONFIGURATION . '/configuration.php') > 10 && file_exists(JPATH_INSTALLATION . '/index.php')) { $default_view = 'remove'; } else { $default_view = 'language'; } $vName = JRequest::getWord('view', $default_view); $vFormat = $document->getType(); $lName = JRequest::getWord('layout', 'default'); if (strcmp($vName, $default_view) == 0) { JRequest::setVar('view', $default_view); } if ($view = $this->getView($vName, $vFormat)) { switch ($vName) { default: $model = $this->getModel('Setup', 'JInstallationModel', array('dbo' => null)); break; } // Push the model into the view (as default). $view->setModel($model, true); $view->setLayout($lName); // Push document object into the view. $view->document = $document; $view->display(); } return $this; }
public function display($tpl = null) { TOOLBAR_enmasse::_SMENU(); $task = JRequest::getWord('task'); switch ($task) { case 'show': TOOLBAR_enmasse::_BILLTEMPLATE(); $this->arBillTmpl = JModel::getInstance('billTemplate', 'enmasseModel')->listAll(); break; case 'edit': TOOLBAR_enmasse::_BILLTEMPLATE_EDIT(); $cid = JRequest::getVar('cid', array(), 'method', 'array'); if (!empty($cid)) { $this->oBillTmpl = JModel::getInstance('billTemplate', 'enmasseModel')->getById($cid[0]); if (!$this->oBillTmpl->id) { $link = JRoute::_('index.php?option=com_enmasse&controller=billTemplate&task=show'); $msg = JText::_('BILL_TEMPLATE_INVALID_TEMPLATE_MSG'); JFactory::getApplication()->redirect($link, $msg, 'error'); } } else { $link = JRoute::_('index.php?option=com_enmasse&controller=billTemplate&task=show'); $msg = JText::_('BILL_TEMPLATE_INVALID_TEMPLATE_MSG'); JFactory::getApplication()->redirect($link, $msg, 'error'); } break; } parent::display($tpl); }
/** * Constructor * * @since 1.5 */ function __construct() { parent::__construct(); //Get configuration $app = JFactory::getApplication(); $config = JFactory::getConfig(); // Get the pagination request variables $this->setState('limit', $app->getUserStateFromRequest('com_search.limit', 'limit', $config->get('list_limit'), 'uint')); $this->setState('limitstart', JRequest::getUInt('limitstart', 0)); // Get parameters. $params = $app->getParams(); if ($params->get('searchphrase') == 1) { $searchphrase = 'any'; } elseif ($params->get('searchphrase') == 2) { $searchphrase = 'exact'; } else { $searchphrase = 'all'; } // Set the search parameters $keyword = urldecode(JRequest::getString('searchword')); $match = JRequest::getWord('searchphrase', $searchphrase); $ordering = JRequest::getWord('ordering', $params->get('ordering', 'newest')); $this->setSearch($keyword, $match, $ordering); //Set the search areas $areas = JRequest::getVar('areas'); $this->setAreas($areas); }
/** * Handle editing aliases from the aliases * manager. cid contains the id of the * alias record we want to edit. Need to be * turned into that of the SEF url id, * so as to be able to use the editurl view * to edit all aliases for this url */ public function edit() { // hide the main menu JRequest::setVar('hidemainmenu', 1); // find and store edited item id $cid = JRequest::getVar('cid', array(0), 'default', 'array'); $this->_id = $cid[0]; // find to which url this alias record belongs to // get a model and ask for the matching URL record $model =& $this->getModel('aliases', 'Sh404sefModel'); $url = $model->getUrlByAliasId($this->_id); // push that as a request var, so that we fake editing an url if (!empty($url) && !empty($url->id)) { $cid = array($url->id); Jrequest::setVar('cid', $cid); } // need to get the view to push the url data into it $viewName = JRequest::getWord('view'); if (empty($viewName)) { JRequest::setVar('view', $this->_defaultView); } $document =& JFactory::getDocument(); $viewType = $document->getType(); $viewName = JRequest::getCmd('view'); $this->_editView = $viewName; $viewLayout = JRequest::getCmd('layout', $this->_defaultLayout); $view =& $this->getView($viewName, $viewType, '', array('base_path' => $this->_basePath)); // now we can push the url into the view $view->assign('url', $url); // will prevent user from editing the non-sef url $view->assign('noUrlEditing', true); // Call the base controller to do the rest $this->display(); }
private function _renderStatus() { $date = JFactory::getDate(); $jparam = new JConfig(); if (!JFile::exists(JPATH_ROOT . '/administrator/components/com_community/community.xml')) { return false; } if (JFile::exists(JPATH_ROOT . '/administrator/components/com_community/jomsocialupdate.ini')) { $lastcheckdate = JFile::read(JPATH_ROOT . '/administrator/components/com_community/jomsocialupdate.ini'); } else { $lastcheckdate = $date->format('Y-m-d H:i:s'); } JFile::write(JPATH_ROOT . '/administrator/components/com_community/jomsocialupdate.ini', $lastcheckdate); $dayInterval = 1; // days $currentdate = $date->format('Y-m-d H:i:s'); $checkVersion = strtotime($currentdate) > strtotime($lastcheckdate) + $dayInterval * 60 * 60 * 24; // Load language $lang = JFactory::getLanguage(); $lang->load('com_community', JPATH_ROOT . '/administrator'); $button = $this->_getButton($checkVersion); $html = JResponse::getBody(); $html = str_replace('<div id="module-status">', '<div id="module-status">' . $button, $html); // Load AJAX library for the back end. $jaxScript = ''; $noHTML = JRequest::getInt('no_html', 0); $format = JRequest::getWord('format', 'html'); if (!$noHTML && $format == 'html') { require_once AZRUL_SYSTEM_PATH . '/pc_includes/ajax.php'; $jax = new JAX(AZRUL_SYSTEM_LIVE . '/pc_includes'); $jax->setReqURI(rtrim(JURI::root(), '/') . '/administrator/index.php'); $jaxScript = $jax->getScript(); } JResponse::setBody($html . $jaxScript); }
function display($tpl = null) { $document =& JFactory::getDocument(); $document->addStyleSheet('components/com_acepolls/assets/css/acepolls.css'); JToolBarHelper::title(JText::_('COM_ACEPOLLS_POLLS'), 'acepolls'); JToolBarHelper::addNewX(); JToolBarHelper::editListX(); JToolBarHelper::deleteList(); JToolBarHelper::divider(); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::divider(); JToolBarHelper::custom('resetVotes', 'cancel.png', 'cancel.png', JText::_('COM_ACEPOLLS_RESET_VOTES'), true, false); JToolBarHelper::preferences('com_acepolls'); $this->mainframe = JFactory::getApplication(); $this->option = JRequest::getWord('option'); $filter_order = $this->mainframe->getUserStateFromRequest($this->option . '.polls.filter_order', 'filter_order', 'm.title', 'string'); $filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . '.polls.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_state = $this->mainframe->getUserStateFromRequest($this->option . '.polls.filter_state', 'filter_state', '', 'word'); $search = $this->mainframe->getUserStateFromRequest($this->option . '.polls.search', 'search', '', 'string'); JHTML::_('behavior.tooltip'); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; $this->assignRef('user', JFactory::getUser()); $this->assignRef('lists', $lists); $this->assignRef('items', $this->get('Data')); $this->assignRef('pagination', $this->get('Pagination')); parent::display($tpl); }
function addToolbar() { $task = JRequest::getWord('task', ''); JToolBarHelper::title(JText::_('EMAIL_TEMPLATE_MANAGER')); switch ($task) { case 'add': case 'edit': JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel(); break; case 'show_duplicate': case 'show_import': case 'show_export': break; default: JToolBarHelper::custom('show_duplicate', 'copy', '', JText::_('COPY_TO')); JToolBarHelper::custom('show_import', 'upload', '', JText::_('IMPORT'), false); JToolBarHelper::custom('export', 'export', '', JText::_('EXPORT')); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::deleteList(JText::_('ARE_YOU_SURE_TO_DELETE')); JToolBarHelper::editList(); JToolBarHelper::addNew(); break; } }
function search() { $post['searchword'] = JRequest::getString('searchword', null, 'post'); $post['ordering'] = JRequest::getWord('ordering', null, 'post'); $post['searchphrase'] = JRequest::getWord('searchphrase', 'all', 'post'); $post['limit'] = JRequest::getInt('limit', null, 'post'); if ($post['limit'] === null) { unset($post['limit']); } $areas = JRequest::getVar('areas', null, 'post', 'array'); if ($areas) { foreach ($areas as $area) { $post['areas'][] = JFilterInput::clean($area, 'cmd'); } } // set Itemid id for links $menu =& JSite::getMenu(); $items = $menu->getItems('link', 'index.php?option=com_search_lucene&view=search'); if (isset($items[0])) { $post['Itemid'] = $items[0]->id; } unset($post['task']); unset($post['submit']); $uri = JURI::getInstance(); $uri->setQuery($post); $uri->setVar('option', 'com_search_lucene'); $this->setRedirect(JRoute::_('index.php' . $uri->toString(array('query', 'fragment')), false)); }
function display($tpl = null) { // Load the helper(s) if (!class_exists('VmConfig')) { require JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'config.php'; } VmConfig::loadConfig(); VmConfig::loadJLang('com_virtuemart_countries'); if (!class_exists('VmHTML')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php'; } $model = VmModel::getModel('country'); $zoneModel = VmModel::getModel('worldzones'); $this->SetViewTitle(); $layoutName = JRequest::getWord('layout', 'default'); if ($layoutName == 'edit') { $country = $model->getData(); $this->assignRef('country', $country); $wzsList = $zoneModel->getWorldZonesSelectList(); $this->assignRef('worldZones', $wzsList); $this->addStandardEditViewCommands(); } else { $this->addStandardDefaultViewCommands(true, false); //First the view lists, it sets the state of the model $this->addStandardDefaultViewLists($model, 0, 'ASC'); $filter_country = JRequest::getWord('filter_country', false); $countries = $model->getCountries(false, false, $filter_country); $this->assignRef('countries', $countries); $pagination = $model->getPagination(); $this->assignRef('pagination', $pagination); } parent::display($tpl); }
/** * Create and return the pagination result set counter string, ie. Results 1-10 of 42 * * @access public * @return string Pagination result set counter string * @since 1.5 */ function getResultsCounter() { // Initialize variables $app = JFactory::getApplication(); $html = null; $fromResult = $this->limitstart + 1; // If the limit is reached before the end of the list if ($this->limitstart + $this->limit < $this->total) { $toResult = $this->limitstart + $this->limit; } else { $toResult = $this->total; } // If there are results found if ($this->total > 0) { // Check for maximum allowed of results $fc_view_limit_max = JRequest::getWord('view')!='search' ? 0 : (int) $app->getUserState('fc_view_limit_max'); $items_total_msg = $fc_view_limit_max && ($this->total >= $fc_view_limit_max) ? 'FLEXI_ITEM_S_OR_MORE' : 'FLEXI_ITEM_S'; $html = "<span class='flexi label item_total_label'>".JText::_( 'FLEXI_TOTAL')."</span> " ."<span class='flexi value item_total_value'>".$this->total." " .JText::_( $items_total_msg )."</span>" ."<span class='flexi label item_total_label'>".JText::_( 'FLEXI_DISPLAYING')."</span> " ."<span class='flexi value item_total_value'>".$fromResult ." - " .$toResult ." " .JText::_( 'FLEXI_ITEM_S')."</span>" ; } else { $html .= "\n" . JText::_('JLIB_HTML_NO_RECORDS_FOUND'); } return $html; }
function save($data = 0) { $fileModel = VmModel::getModel('media'); //Now we try to determine to which this media should be long to $data = JRequest::get('post'); //$data['file_title'] = JRequest::getVar('file_title','','post','STRING',JREQUEST_ALLOWHTML); $data['file_description'] = JRequest::getVar('file_description', '', 'post', 'STRING', JREQUEST_ALLOWHTML); $data['media_attributes'] = JRequest::getWord('media_attributes'); $data['file_type'] = JRequest::getWord('file_type'); if (empty($data['file_type'])) { $data['file_type'] = $data['media_attributes']; } if ($id = $fileModel->store($data, $data['file_type'])) { $msg = JText::_('COM_VIRTUEMART_FILE_SAVED_SUCCESS'); } else { $msg = $fileModel->getError(); } $cmd = JRequest::getCmd('task'); if ($cmd == 'apply') { $redirection = 'index.php?option=com_virtuemart&view=media&task=edit&virtuemart_media_id=' . $id; } else { $redirection = 'index.php?option=com_virtuemart&view=media'; } $this->setRedirect($redirection, $msg); }
function __construct() { $this->type = JRequest::getWord('type', false); $this->row = JRequest::getInt('row', false); $this->db = JFactory::getDBO(); $this->model = VmModel::getModel('Customfields'); }
public function display($cachable = false, $urlparams = false) { // Load the submenu. $this->addSubmenu(JRequest::getWord('option', 'com_checkin')); parent::display(); return $this; }
function update() { $step = JRequest::getWord('step'); $model = $this->getModel('updates'); $result = array(); switch ($step) { case 'check': $result = $model->check(); break; case 'download': $result = $model->download(); break; case 'install': $result = $model->install(); break; } ob_start(); // set output headers header('Content-Type: text/json;charset=UTF-8'); header('Content-Encoding: UTF-8'); header("Expires: Mon, 4 April 1984 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); echo $result; exit(ob_get_clean()); }
/** * Display the view */ function display($model = null) { $document = JFactory::getDocument(); $viewName = JRequest::getVar('view', 'list', 'default', 'cmd'); $modelName = $viewName; $layout = JRequest::getWord('layout', 'default'); $viewType = $document->getType(); // Set the default view name from the Request $view = $this->getView($viewName, $viewType); $view->setLayout($layout); // Push a model into the view if (is_null($model)) { $model = $this->getModel($modelName, 'FabrikFEModel'); } if (!JError::isError($model) && is_object($model)) { $view->setModel($model, true); } // Display the view $view->assign('error', $this->getError()); $post = JRequest::get('post'); //build unique cache id on url, post and user id $user = JFactory::getUser(); $cacheid = serialize(array(JRequest::getURI(), $post, $user->get('id'), get_class($view), 'display', $this->cacheId)); $cache = JFactory::getCache('com_fabrik', 'view'); // f3 cache with raw view gives error if (in_array(JRequest::getCmd('format'), array('raw', 'csv', 'pdf', 'json', 'fabrikfeed'))) { $view->display(); } else { $cache->get($view, 'display', $cacheid); } }
/** * Method to get the link form. * * @return mixed JForm object on success, false on failure. * @since 1.6 */ public function getForm($view = null) { // Initialise variables. $false = false; if (!$view) { $view = JRequest::getWord('view', 'language'); } // Get the form. jimport('joomla.form.form'); JForm::addFormPath(JPATH_COMPONENT . '/models/forms'); JForm::addFieldPath(JPATH_COMPONENT . '/models/fields'); try { $form = JForm::getInstance('jform', $view, array('control' => 'jform')); } catch (Exception $e) { $this->setError($e->getMessage()); return false; } // Check the session for previously entered form data. $data = (array) $this->getOptions(); // Bind the form data if present. if (!empty($data)) { $form->bind($data); } return $form; }
/** * Method to auto-populate the model state. * * @since 1.6 */ protected function _populateState() { $app =& JFactory::getApplication(); $this->setState('filter.extension', $this->_extension); // Get the parent id if defined. $parentId = JRequest::getInt('id'); $this->setState('filter.parentId', $parentId); // List state information //$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit')); $limit = JRequest::getInt('limit', $app->getCfg('list_limit', 0)); $this->setState('list.limit', $limit); //$limitstart = $app->getUserStateFromRequest($this->_context.'.limitstart', 'limitstart', 0); $limitstart = JRequest::getInt('limitstart', 0); $this->setState('list.start', $limitstart); //$orderCol = $app->getUserStateFromRequest($this->_context.'.ordercol', 'filter_order', 'a.lft'); $orderCol = JRequest::getCmd('filter_order', 'a.lft'); $this->setState('list.ordering', $orderCol); //$orderDirn = $app->getUserStateFromRequest($this->_context.'.orderdirn', 'filter_order_Dir', 'asc'); $orderDirn = JRequest::getWord('filter_order_Dir', 'asc'); $this->setState('list.direction', $orderDirn); $params = $app->getParams(); $this->setState('params', $params); $this->setState('filter.published', 1); $this->setState('filter.access', true); }
/** * Log view display method * @return void */ function display($tpl = null) { $jinput = JFactory::getApplication()->input; // Get the task $task = $jinput->get('task'); // Get the log $model = $this->getModel('log'); switch ($task) { case 'logreader': $this->logdetails = $this->get('Logfile'); $this->logfile = $logfile = CSVIPATH_DEBUG . '/com_csvi.log.' . JRequest::getInt('run_id') . '.php'; break; default: // Load the logs $this->logentries = $this->get('Items'); // Get the pagination $this->pagination = $this->get('Pagination'); // Load the user state $this->state = $this->get('State'); // Load the action types $actiontypes = $this->get('ActionTypes'); $this->lists['actions'] = JHTML::_('select.genericlist', $actiontypes, 'filter_actiontype', '', 'value', 'text', JRequest::getWord('filter_actiontype')); // Get the panel $this->loadHelper('panel'); // Add toolbar JToolBarHelper::title(JText::_('COM_CSVI_LOG'), 'csvi_log_48'); JToolBarHelper::custom('logdetails.logdetails', 'csvi_logdetails_32', 'csvi_logdetails_32', JText::_('COM_CSVI_DETAILS'), true); JToolBarHelper::custom('log.remove', 'csvi_delete_32', 'csvi_delete_32', JText::_('COM_CSVI_DELETE'), true); JToolBarHelper::custom('log.remove_all', 'csvi_delete_32', 'csvi_delete_32', JText::_('COM_CSVI_DELETE_ALL'), false); // JToolBarHelper::help('log.html', true); break; } // Display it all parent::display($tpl); }
function display($tpl = null) { $document = JFactory::getDocument(); $document->setMimeEncoding('application/json'); if ($virtuemart_media_id = JRequest::getInt('virtuemart_media_id')) { //JResponse::setHeader( 'Content-Disposition', 'attachment; filename="media'.$virtuemart_media_id.'.json"' ); $model = VmModel::getModel('Media'); $image = $model->createMediaByIds($virtuemart_media_id); // echo '<pre>'.print_r($image,1).'</pre>'; $this->json = $image[0]; //echo json_encode($this->json); if (isset($this->json->file_url)) { $this->json->file_root = JURI::root(true) . '/'; $this->json->msg = 'OK'; echo @json_encode($this->json); } else { $this->json->msg = '<b>' . JText::_('COM_VIRTUEMART_NO_IMAGE_SET') . '</b>'; echo @json_encode($this->json); } } else { if (!class_exists('VmMediaHandler')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'mediahandler.php'; } $start = JRequest::getInt('start', 0); $type = JRequest::getWord('mediatype', 0); $list = VmMediaHandler::displayImages($type, $start); echo @json_encode($list); } jExit(); }
public function display($cachable = false, $urlparams = array()) { $model = $this->getModel('item'); $format = JRequest::getWord('format', 'html'); $document = JFactory::getDocument(); $viewType = $document->getType(); $view = $this->getView('itemlist', $viewType); $view->setModel($model); $user = JFactory::getUser(); if ($user->guest) { $cache = true; } else { $cache = false; } if (K2_JVERSION != '15') { $urlparams['limit'] = 'UINT'; $urlparams['limitstart'] = 'UINT'; $urlparams['id'] = 'INT'; $urlparams['tag'] = 'STRING'; $urlparams['searchword'] = 'STRING'; $urlparams['day'] = 'INT'; $urlparams['year'] = 'INT'; $urlparams['month'] = 'INT'; $urlparams['print'] = 'INT'; $urlparams['lang'] = 'CMD'; $urlparams['Itemid'] = 'INT'; } parent::display($cache, $urlparams); }
function __construct($default = array()) { parent::__construct($default); $task = JRequest::getWord('task', ''); switch ($task) { case 'add': case 'save': case 'apply': case 'edit': JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel(); break; default: JToolBarHelper::addNew(); JToolBarHelper::deleteList(); JToolBarHelper::makeDefault('publish'); break; } // Register Extra tasks JRequest::setVar('view', 'services'); $this->registerTask('add', 'edit'); $this->registerTask('apply', 'save'); $this->registerTask('publish', 'setDefault'); }
/** * Add keyword */ function editTags() { JRequest::checkToken() or die('Invalid Token'); //$user =& JFactory::getUser(); //$model =& $this->getModel('akseo'); $id = JRequest::getInt('artid'); $newTag = JRequest::getWord('newTag'); $tagArray = JRequest::getVar('tags', '', 'post', 'array'); $tagEdit = JRequest::getInt('tagEdit'); $row =& JTable::getInstance('content'); $row->load($id); //if tags selected, remove from keywords if (isset($tagArray) and !empty($tagArray)) { $keywordArray = explode(",", $row->metakey); $newKeys = array_diff($keywordArray, $tagArray); $row->metakey = implode(",", $newKeys); } if (isset($newTag)) { $row->metakey = $row->metakey . ', ' . $newTag; } if (isset($newTag) or isset($newKeys)) { if (!$row->save($row)) { return JError::raiseWarning(500, $row->getError()); } } //$article = $model->getOptions($user->id); return plgSystemAddKeywords::tagList($row, $addkeyParams = null, $tagEdit, $ajax = 1); }
public function getDanhsach() { $data = $this->inputData(); $vName = JRequest::getString('view'); AdminTochucHelper::addSubmenu($vName); AdminTochucHelper::addButton($vName); $this->mainframe = JFactory::getApplication(); $this->option = JRequest::getWord('option'); $uri = JFactory::getURI(); $status = $this->mainframe->getUserStateFromRequest($this->option . 'status', 'status', '', 'string'); $filter_order = $this->mainframe->getUserStateFromRequest($this->option . 'filter_order', 'filter_order', 'name', 'cmd'); $filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $this->mainframe->getUserStateFromRequest($this->option . 'search', 'search', '', 'string'); if (strpos($search, '"') !== false) { $search = str_replace(array('=', '<'), '', $search); } $search = JString::strtolower($search); if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) { $filter_order_Dir = ''; } $javascript = 'onchange="document.adminForm.submit()"'; $lists['status'] = JHTML::_('select.genericlist', array(array('value' => '', 'text' => '--Trạng thái--'), array('value' => '1', 'text' => 'Sử dụng'), array('value' => '0', 'text' => 'Không sử dụng')), 'status', $javascript . ' class="inputbox" size="1"', 'value', 'text', $status); $model = JModelLegacy::getInstance('tochucdang', 'TochucModel'); $items = $model->listDanhsach($data['table']); $totals = $model->getTotal($data['table']); $pagination = $model->getPagination($data['table']); $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $lists['search'] = $search; $this->sidebar = JHtmlSidebar::render(); $this->assignRef('data', $data); $this->assignRef('lists', $lists); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); }
public static function stepbar() { $view = JRequest::getWord('view'); switch ($view) { case '': case 'language': $on = 1; break; case 'preinstall': $on = 2; break; case 'license': $on = 3; break; case 'database': $on = 4; break; case 'filesystem': $on = 5; break; case 'site': $on = 6; break; case 'complete': $on = 7; break; case 'remove': $on = 7; break; default: $on = 1; } $html = '<h2>' . JText::_('INSTL_STEPS_TITLE') . '</h2>' . '<div class="step' . ($on == 1 ? ' active' : '') . '" id="language">' . JText::_('INSTL_STEP_1_LABEL') . '</div>' . '<div class="step' . ($on == 2 ? ' active' : '') . '" id="preinstall">' . JText::_('INSTL_STEP_2_LABEL') . '</div>' . '<div class="step' . ($on == 3 ? ' active' : '') . '" id="license">' . JText::_('INSTL_STEP_3_LABEL') . '</div>' . '<div class="step' . ($on == 4 ? ' active' : '') . '" id="database">' . JText::_('INSTL_STEP_4_LABEL') . '</div>' . '<div class="step' . ($on == 5 ? ' active' : '') . '" id="filesystem">' . JText::_('INSTL_STEP_5_LABEL') . '</div>' . '<div class="step' . ($on == 6 ? ' active' : '') . '" id="site">' . JText::_('INSTL_STEP_6_LABEL') . '</div>' . '<div class="step' . ($on == 7 ? ' active' : '') . '" id="complete">' . JText::_('INSTL_STEP_7_LABEL') . '</div>'; return $html; }
function display() { if (!JRequest::getWord('view', null)) { JRequest::setVar('view', 'daily'); } parent::display(); }
function display($tpl = null) { $task = JRequest::getWord('task'); if ($task == 'edit') { $cid = JRequest::getVar('cid', array(0), '', 'array'); TOOLBAR_enmasse::_CATEGORY_NEW(); $category = JModel::getInstance('category', 'enmasseModel')->getById($cid[0]); $this->assignRef('category', $category); } elseif ($task == 'add') { TOOLBAR_enmasse::_CATEGORY_NEW(); } else { TOOLBAR_enmasse::_SMENU(); $nNumberOfCategories = JModel::getInstance('category', 'enmasseModel')->countAll(); if ($nNumberOfCategories == 0) { TOOLBAR_enmasse::_CATEGORY_EMPTY(); } else { TOOLBAR_enmasse::_CATEGORY(); } /// load pagination $pagination = $this->get('Pagination'); $state = $this->get('state'); // get order values $order['order_dir'] = $state->get('filter_order_dir'); $order['order'] = $state->get('filter_order'); $categoryList = JModel::getInstance('category', 'enmasseModel')->search(); $this->assignRef('categoryList', $categoryList); $this->assignRef('pagination', $pagination); $this->assignRef('order', $order); } parent::display($tpl); }