/** * Display the view * * */ public function display($tpl = null) { $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); // What Access Permissions does this user have? What can (s)he do? $this->canDo = jdownloadsHelper::getActions(); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); parent::display($tpl); }
/** * Add the page title and toolbar. * */ protected function addToolbar() { JRequest::setVar('hidemainmenu', 1); $user = JFactory::getUser(); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); $canDo = jdownloadsHelper::getActions(); $document = JFactory::getDocument(); $document->addStyleSheet('components/com_jdownloads/assets/css/style.css'); JToolBarHelper::title(JText::_('COM_JDOWNLOADS') . ': ' . JText::_('COM_JDOWNLOADS_USERGROUP_EDIT_TITLE'), 'jdgroups'); if ($canDo->get('edit.user.limits')) { JToolBarHelper::apply('group.apply'); JToolBarHelper::save('group.save'); } JToolBarHelper::cancel('group.cancel', 'JTOOLBAR_CLOSE'); JToolBarHelper::divider(); JToolBarHelper::help('help.group', true); }
/** * uploads display method * @return void **/ function display($tpl = null) { global $jlistConfig; jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); // What Access Permissions does this user have? What can (s)he do? $this->canDo = jdownloadsHelper::getActions(); $language = JFactory::getLanguage(); $lang = $language->getTag(); $langfiles = JPATH_COMPONENT_ADMINISTRATOR . '/assets/plupload/js/i18n/'; $PLdataDir = JURI::root() . "administrator/components/com_jdownloads/assets/plupload/"; $document = JFactory::getDocument(); $PLuploadScript = new PLuploadScript($PLdataDir); $runtimeScript = $PLuploadScript->runtimeScript; $runtime = $PLuploadScript->runtime; //add default PL css $document->addStyleSheet($PLdataDir . 'css/plupload.css'); //add PL styles and scripts $document->addStyleSheet($PLdataDir . 'js/jquery.plupload.queue/css/jquery.plupload.queue.css', 'text/css', 'screen'); $document->addScript($PLdataDir . 'js/jquery.min.js'); $document->addScript($PLdataDir . 'js/plupload.full.min.js'); // load plupload language file if ($lang) { if (JFile::exists($langfiles . $lang . '.js')) { $document->addScript($PLdataDir . 'js/i18n/' . $lang . '.js'); } else { $document->addScript($PLdataDir . 'js/i18n/en-GB.js'); } } $document->addScript($PLdataDir . 'js/jquery.plupload.queue/jquery.plupload.queue.js'); $document->addScriptDeclaration($PLuploadScript->getScript()); //set variables for the template $this->enableLog = $jlistConfig['plupload.enable.uploader.log']; $this->runtime = $runtime; $this->currentDir = $jlistConfig['files.uploaddir'] . '/'; //set toolbar $this->addToolBar(); $this->sidebar = JHtmlSidebar::render(); // Display the template parent::display($tpl); }
/** * Display the view * * */ public function display($tpl = null) { $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); // What Access Permissions does this user have? What can (s)he do? $this->canDo = jdownloadsHelper::getActions(); // get filename when selected in files list $session = JFactory::getSession(); $filename = $session->get('jd_filename'); if ($filename) { $this->selected_filename = JFilterOutput::cleanText($filename); } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); parent::display($tpl); }
/** * categories view display method * @return void **/ function display($tpl = null) { $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); // What Access Permissions does this user have? What can (s)he do? $this->canDo = jdownloadsHelper::getActions(); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Preprocess the list of items to find ordering divisions. foreach ($this->items as &$item) { $this->ordering[$item->parent_id][] = $item->id; } //$params = JComponentHelper::getParams('com_jdownloads'); // Levels filter. $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('J1')); $options[] = JHtml::_('select.option', '2', JText::_('J2')); $options[] = JHtml::_('select.option', '3', JText::_('J3')); $options[] = JHtml::_('select.option', '4', JText::_('J4')); $options[] = JHtml::_('select.option', '5', JText::_('J5')); $this->assign('levels', $options); // build categories list box for batch operations $lists = array(); $config = array('filter.published' => array(0, 1)); $select[] = JHtml::_('select.option', 0, JText::_('COM_JDOWNLOADS_SELECT_CATEGORY')); $select[] = JHtml::_('select.option', 1, JText::_('COM_JDOWNLOADS_BATCH_ROOT_CAT')); // get the categories data $categories = $this->getCategoriesList($config); $this->categories = @array_merge($select, $categories); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }
/** * Add the page title and toolbar. * */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/jdownloadshelper.php'; $document = JFactory::getDocument(); $document->addStyleSheet('components/com_jdownloads/assets/css/style.css'); JDownloadsHelper::addSubmenu('groups'); JToolBarHelper::title(JText::_('COM_JDOWNLOADS') . ': ' . JText::_('COM_JDOWNLOADS_USER_GROUPS'), 'jdgroups'); $canDo = jdownloadsHelper::getActions(); if ($canDo->get('edit.config')) { JToolBarHelper::editList('group.edit', 'COM_JDOWNLOADS_USERGROUPS_CHANGE_LIMITS_TITLE'); JToolBarHelper::divider(); } if ($canDo->get('core.admin')) { JToolBarHelper::custom('groups.resetLimits', 'reset', 'reset', JText::_('COM_JDOWNLOADS_USERGROUPS_RESET_LIMITS_TITLE'), true, false); JToolBarHelper::divider(); } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_jdownloads'); JToolBarHelper::divider(); } if ($canDo->get('edit.config')) { JToolBarHelper::help('help.groups', true); } }
defined('_JEXEC') or die('Restricted access'); global $jlistConfig; jimport('joomla.html.html.tabs'); JHtml::_('behavior.tooltip'); JHTML::_('behavior.formvalidation'); // JHtml::_('behavior.formvalidator'); Joomla >= 3.4 JHtml::_('jquery.framework'); $user = JFactory::getUser(); $db = JFactory::getDBO(); $db->setQuery("SELECT `rules` FROM #__assets WHERE `name` = 'com_jdownloads' AND `title` = 'com_jdownloads' AND `level` = '1'"); $component_rules = $db->loadResult(); // get download stats $stats_data = jdownloadsHelper::getDownloadStatsData(); $sum_downloads = jdownloadsHelper::getSumDownloads(); $user_rules = jdownloadsHelper::getUserRules(); $canDo = jdownloadsHelper::getActions(); $option = 'com_jdownloads'; // check that we have valid user rules // when not, create it from joomla users if (!$user_rules) { $user_result = jdownloadsHelper::setUserRules(); } // view not the control panel when we must move the data from old release (< 2.5) if (!$jlistConfig['old.jd.release.found']) { ?> <form action="index.php" method="post" name="adminForm"> <div id="j-main-container" class="span10"> <div class="adminform"> <div class="jd-cpanel-left">