protected function getInput()
 {
     $db = JFactory::getDBO();
     //build the list of categories
     $query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid' . ' FROM #__phocadownload_categories AS a' . ' WHERE a.published = 1' . ' ORDER BY a.ordering';
     $db->setQuery($query);
     $data = $db->loadObjectList();
     // TODO - check for other views than category edit
     $view = JRequest::getVar('view');
     $catId = -1;
     if ($view == 'phocadownloadcat') {
         $id = $this->form->getValue('id');
         // id of current category
         if ((int) $id > 0) {
             $catId = $id;
         }
     }
     /*if ($view == 'phocadownloadfile') {
     			$id 	= $this->form->getValue('catid'); // id of current category
     			if ((int)$id > 0) {
     				$catId = $id;
     			}
     		}*/
     $required = (string) $this->element['required'] == 'true' ? TRUE : FALSE;
     $tree = array();
     $text = '';
     $tree = PhocaDownloadCategory::CategoryTreeOption($data, $tree, 0, $text, $catId);
     //if ($required == TRUE) {
     //} else {
     array_unshift($tree, JHTML::_('select.option', '', '- ' . JText::_('COM_PHOCADOWNLOAD_SELECT_CATEGORY') . ' -', 'value', 'text'));
     //}
     return JHTML::_('select.genericlist', $tree, $this->name, 'class="inputbox"', 'value', 'text', $this->value, $this->id);
 }
Beispiel #2
0
	function display($tpl = null) {
		$app	= JFactory::getApplication();
		JHtml::_('behavior.tooltip');
		JHtml::_('behavior.formvalidation');
		JHtml::_('behavior.keepalive');
		JHtml::_('formbehavior.chosen', 'select');
		
		//Frontend Changes
		$tUri = '';
		if (!$app->isAdmin()) {
			$tUri = JURI::base();
			
		}
		
		$document	= JFactory::getDocument();
		$uri		= JFactory::getURI();
		JHTML::stylesheet( 'media/com_phocadownload/css/administrator/phocadownload.css' );
		
		$eName				= JRequest::getVar('e_name');
		$this->t['ename']		= preg_replace( '#[^A-Z0-9\-\_\[\]]#i', '', $eName );
		$this->t['backlink']	= $tUri.'index.php?option=com_phocadownload&view=phocadownloadlinks&tmpl=component&e_name='.$this->t['ename'];
		
		
		// Category Tree
		$db = JFactory::getDBO();
		$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid'
		. ' FROM #__phocadownload_categories AS a'
	//	. ' WHERE a.published = 1' You can hide not published and not authorized categories too
	//	. ' AND a.approved = 1'
		. ' ORDER BY a.ordering';
		$db->setQuery( $query );
		$categories = $db->loadObjectList();

		$tree = array();
		$text = '';
		$tree = PhocaDownloadCategory::CategoryTreeOption($categories, $tree, 0, $text, -1);
		//-----------------------------------------------------------------------
		
		// Multiple
		$ctrl	= 'hidecategories';
		$attribs	= ' ';
		$attribs	.= ' size="5"';
		//$attribs	.= 'class="'.$v.'"';
		$attribs	.= ' class="inputbox"';
		$attribs	.= ' multiple="multiple"';
		$ctrl		.= '';
		//$value		= implode( '|', )
		
		$categoriesOutput = JHTML::_('select.genericlist', $tree, $ctrl, $attribs, 'value', 'text', 0, 'hidecategories' );
		
		$this->assignRef('categoriesoutput',	$categoriesOutput);
		
		parent::display($tpl);
	}
Beispiel #3
0
	function display($tpl = null) {
		$app	= JFactory::getApplication();
		$db		= JFactory::getDBO();
		JHtml::_('behavior.tooltip');
		JHtml::_('behavior.formvalidation');
		JHtml::_('behavior.keepalive');
		JHtml::_('formbehavior.chosen', 'select');
		//Frontend Changes
		$tUri = '';
		if (!$app->isAdmin()) {
			$tUri = JURI::base();
			
		}
		
		$document	= JFactory::getDocument();
		$uri		= JFactory::getURI();
		JHTML::stylesheet( 'media/com_phocadownload/css/administrator/phocadownload.css' );
		
		$eName				= JRequest::getVar('e_name');
		$this->t['ename']		= preg_replace( '#[^A-Z0-9\-\_\[\]]#i', '', $eName );
		$this->t['backlink']	= $tUri.'index.php?option=com_phocadownload&view=phocadownloadlinks&tmpl=component&e_name='.$this->t['ename'];
		
		$model 			= $this->getModel();
		
		// build list of categories
		//$javascript 	= 'class="inputbox" size="1" onchange="submitform( );"';
		$javascript 	= 'class="inputbox" size="1"';
		$filter_catid	= '';
		
		$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid'
		. ' FROM #__phocadownload_categories AS a'
		. ' WHERE a.published = 1'
		//. ' AND a.approved = 1'
		. ' ORDER BY a.ordering';
		$db->setQuery( $query );
		$phocadownloads = $db->loadObjectList();

		$tree = array();
		$text = '';
		$tree = PhocaDownloadCategory::CategoryTreeOption($phocadownloads, $tree, 0, $text, -1);
		array_unshift($tree, JHTML::_('select.option', '0', '- '.JText::_('COM_PHOCADOWNLOAD_SELECT_CATEGORY').' -', 'value', 'text'));
		$lists['catid'] = JHTML::_( 'select.genericlist', $tree, 'catid',  $javascript , 'value', 'text', $filter_catid );
		//-----------------------------------------------------------------------
		
		$this->assignRef('lists',	$lists);
		
		parent::display($tpl);
	}
Beispiel #4
0
 public static function item($published, $category = 0)
 {
     // Create the copy/move options.
     $options = array(JHtml::_('select.option', 'c', JText::_('JLIB_HTML_BATCH_COPY')), JHtml::_('select.option', 'm', JText::_('JLIB_HTML_BATCH_MOVE')));
     $db = JFactory::getDBO();
     //build the list of categories
     $query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid' . ' FROM #__phocadownload_categories AS a' . ' ORDER BY a.ordering';
     $db->setQuery($query);
     $data = $db->loadObjectList();
     $tree = array();
     $text = '';
     $catId = -1;
     $tree = PhocaDownloadCategory::CategoryTreeOption($data, $tree, 0, $text, $catId);
     if ($category == 1) {
         array_unshift($tree, JHTML::_('select.option', 0, JText::_('JLIB_HTML_ADD_TO_ROOT'), 'value', 'text'));
     }
     // Create the batch selector to change select the category by which to move or copy.
     $lines = array('<label id="batch-choose-action-lbl" for="batch-choose-action">', JText::_('JLIB_HTML_BATCH_MENU_LABEL'), '</label>', '<fieldset id="batch-choose-action" class="combo">', '<select name="batch[category_id]" class="inputbox" id="batch-category-id">', '<option value="">' . JText::_('JSELECT') . '</option>', JHTML::_('select.options', $tree), '</select>', JHTML::_('select.radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'), '</fieldset>');
     return implode("\n", $lines);
 }
Beispiel #5
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $uri = JFactory::getURI();
     $document = JFactory::getDocument();
     $db = JFactory::getDBO();
     JHtml::_('behavior.tooltip');
     JHtml::_('behavior.formvalidation');
     JHtml::_('behavior.keepalive');
     JHtml::_('formbehavior.chosen', 'select');
     //Frontend Changes
     $tUri = '';
     if (!$app->isAdmin()) {
         $tUri = JURI::base();
     }
     JHTML::stylesheet('media/com_phocadownload/css/administrator/phocadownload.css');
     $eName = $app->input->get('e_name');
     $this->t['ename'] = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName);
     $this->t['type'] = $app->input->get('type', 1, '', 'int');
     $this->t['backlink'] = $tUri . 'index.php?option=com_phocadownload&amp;view=phocadownloadlinks&amp;tmpl=component&amp;e_name=' . $this->t['ename'];
     $params = JComponentHelper::getParams('com_phocadownload');
     //Filter
     $context = 'com_phocadownload.phocadownload.list.';
     //$sectionid			= $app->input->get( 'sectionid', -1, '', 'int' );
     //$redirect			= $sectionid;
     $option = JRequest::getCmd('option');
     $filter_state = $app->getUserStateFromRequest($this->_context . '.filter_state', 'filter_state', '', 'word');
     $filter_catid = $app->getUserStateFromRequest($this->_context . '.filter_catid', 'filter_catid', 0, 'int');
     $catid = $app->getUserStateFromRequest($this->_context . '.catid', 'catid', 0, 'int');
     //	$filter_sectionid	= $app->getUserStateFromRequest( $this->_context.'.filter_sectionid','filter_sectionid',	-1,	'int');
     $filter_order = $app->getUserStateFromRequest($this->_context . '.filter_order', 'filter_order', 'a.ordering', 'cmd');
     $filter_order_Dir = $app->getUserStateFromRequest($this->_context . '.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $app->getUserStateFromRequest($this->_context . '.search', 'search', '', 'string');
     $search = JString::strtolower($search);
     // Get data from the model
     $items = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     // build list of categories
     if ($this->t['type'] != 4) {
         $javascript = 'class="inputbox" size="1" onchange="submitform( );"';
     } else {
         $javascript = '';
     }
     // get list of categories for dropdown filter
     $filter = '';
     //if ($filter_sectionid > 0) {
     //	$filter = ' WHERE cc.section = '.$db->Quote($filter_sectionid);
     //}
     // get list of categories for dropdown filter
     $query = 'SELECT cc.id AS value, cc.title AS text' . ' FROM #__phocadownload_categories AS cc' . $filter . ' ORDER BY cc.ordering';
     if ($this->t['type'] != 4) {
         $lists['catid'] = PhocaDownloadCategory::filterCategory($query, $catid, null, true, true);
     } else {
         $lists['catid'] = PhocaDownloadCategory::filterCategory($query, $catid, null, false, true);
     }
     /*
     		if ($this->t['type'] != 4) {
     			$lists['catid'] = PhocaDownloadCategory::filterCategory($query, $catid, null, true);
     		} else {
     			$lists['catid'] = PhocaDownloadCategory::filterCategory($query, $catid, null, false);
     		}*/
     // sectionid
     /*$query = 'SELECT s.title AS text, s.id AS value'
     		. ' FROM #__phocadownload_sections AS s'
     		. ' WHERE s.published = 1'
     		. ' ORDER BY s.ordering';
     		
     		$lists['sectionid'] = PhocaDownloadCategory::filterSection($query, $filter_sectionid);*/
     // 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('tmpl', $this->t);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('request_url', $uri->toString());
     parent::display($tpl);
 }
Beispiel #6
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $uri = JFactory::getURI();
     $menus = $app->getMenu();
     $menu = $menus->getActive();
     $this->t['p'] = $app->getParams();
     $user = JFactory::getUser();
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $userLevels = implode(',', $user->getAuthorisedViewLevels());
     $this->t['pi'] = 'media/com_phocadownload/images/';
     $this->t['pp'] = 'index.php?option=com_phocadownload&view=user&controller=user';
     $this->t['pl'] = 'index.php?option=com_users&view=login&return=' . base64_encode($this->t['pp'] . '&Itemid=' . $app->input->get('Itemid', 0, 'int'));
     $neededAccessLevels = PhocaDownloadAccess::getNeededAccessLevels();
     $access = PhocaDownloadAccess::isAccess($user->getAuthorisedViewLevels(), $neededAccessLevels);
     if (!$access) {
         $app->redirect(JRoute::_($this->t['pl'], false), JText::_("COM_PHOCADOWNLOAD_NOT_AUTHORISED_ACTION"));
         return;
     }
     PhocaDownloadRenderFront::renderAllCSS();
     // = = = = = = = = = = =
     // PANE
     // = = = = = = = = = = =
     // - - - - - - - - - -
     // ALL TABS
     // - - - - - - - - - -
     // UCP is disabled (security reasons)
     if ((int) $this->t['p']->get('enable_user_cp', 0) == 0) {
         $app->redirect(JURI::base(false), JText::_("COM_PHOCADOWNLOAD_USER_UPLOAD_DISABLED"));
         exit;
     }
     $this->t['tab'] = $app->input->get('tab', 0, 'string');
     $this->t['maxuploadchar'] = $this->t['p']->get('max_upload_char', 1000);
     $this->t['enableuseruploadapprove'] = $this->t['p']->get('enable_user_upload_approve', 0);
     $this->t['showpageheading'] = $this->t['p']->get('show_page_heading', 1);
     $this->t['uploadmaxsize'] = $this->t['p']->get('user_file_upload_size', 3145728);
     $this->t['uploadmaxsizeread'] = PhocaDownloadFile::getFileSizeReadable($this->t['uploadmaxsize']);
     $this->t['userfilesmaxcount'] = $this->t['p']->get('user_files_max_count', 5);
     $this->t['userfilesmaxsize'] = $this->t['p']->get('user_files_max_size', 20971520);
     $this->t['send_mail_upload'] = $this->t['p']->get('send_mail_upload', 0);
     $this->t['pw'] = PhocaDownloadRenderFront::renderPhocaDownload();
     //Subcateogry
     //$this->t['parentid']			= $app->input->get('parentcategoryid', 0, 'int');
     //$document->addScript(JURI::base(true).'/components/com_phocadownload/assets/js/comments.js');
     $document->addCustomTag(PhocaDownloadRenderFront::renderOnUploadJS());
     $document->addCustomTag(PhocaDownloadRenderFront::renderDescriptionUploadJS((int) $this->t['maxuploadchar']));
     $document->addCustomTag(PhocaDownloadRenderFront::userTabOrdering());
     $model = $this->getModel('user');
     // Upload Form - - - - - - - - - - - - - - -
     $ftp = !JClientHelper::hasCredentials('ftp');
     // Set FTP form
     $session = JFactory::getSession();
     $this->assignRef('session', $session);
     // END Upload Form - - - - - - - - - - - - -
     $this->t['displayupload'] = 1;
     // - - - - - - - - - -
     // FORM
     // - - - - - - - - - -
     // No Controller because of returning back the values in case some form field is not OK
     // Set default for returning back
     $formData = new JObject();
     $formData->set('title', '');
     $formData->set('description', '');
     $formData->set('author', '');
     $formData->set('email', '');
     $formData->set('license', '');
     $formData->set('website', '');
     $formData->set('version', '');
     $this->t['errorcatid'] = '';
     $this->t['erroremail'] = '';
     $this->t['errorwebsite'] = '';
     $this->t['errorfile'] = '';
     $task = $app->input->get('task', '', 'string');
     if ($task == 'upload') {
         $post['title'] = $app->input->get('phocadownloaduploadtitle', '', 'string');
         $post['description'] = $app->input->get('phocadownloaduploaddescription', '', 'string');
         $post['catidfiles'] = $app->input->get('catidfiles', 0, 'int');
         $post['description'] = substr($post['description'], 0, (int) $this->t['maxuploadchar']);
         $post['approved'] = 0;
         $post['published'] = 1;
         $post['owner_id'] = $user->id;
         if ($this->t['enableuseruploadapprove'] == 0) {
             $post['approved'] = 1;
         }
         $post['author'] = $app->input->get('phocadownloaduploadauthor', '', 'string');
         $post['email'] = $app->input->get('phocadownloaduploademail', '', 'string');
         $post['website'] = $app->input->get('phocadownloaduploadwebsite', '', 'string');
         $post['license'] = $app->input->get('phocadownloaduploadlicense', '', 'string');
         $post['version'] = $app->input->get('phocadownloaduploadversion', '', 'string');
         if ($post['title'] != '') {
             $formData->set('title', $post['title']);
         }
         if ($post['description'] != '') {
             $formData->set('description', $post['description']);
         }
         if ($post['author'] != '') {
             $formData->set('author', $post['author']);
         }
         if ($post['email'] != '') {
             $formData->set('email', $post['email']);
         }
         if ($post['website'] != '') {
             $formData->set('website', $post['website']);
         }
         if ($post['license'] != '') {
             $formData->set('license', $post['license']);
         }
         if ($post['version'] != '') {
             $formData->set('version', $post['version']);
         }
         //catid
         $returnForm = 0;
         if ($post['catidfiles'] < 1) {
             $this->t['errorcatid'] = JText::_('COM_PHOCADOWNLOAD_PLEASE_SELECT_CATEGORY');
             $returnForm = 1;
         }
         jimport('joomla.mail.helper');
         if ($post['email'] != '' && !JMailHelper::isEmailAddress($post['email'])) {
             $this->t['erroremail'] = JText::_('COM_PHOCADOWNLOAD_PLEASE_ENTER_VALID_EMAIL_ADDRESS');
             $returnForm = 1;
         }
         if ($post['website'] != '' && !PhocaDownloadUtils::isURLAddress($post['website'])) {
             $this->t['errorwebsite'] = JText::_('COM_PHOCADOWNLOAD_PLEASE_ENTER_VALID_WEBSITE');
             $returnForm = 1;
         }
         // Upload
         $errUploadMsg = '';
         $redirectUrl = '';
         $fileArray = JRequest::getVar('Filedata', '', 'files', 'array');
         if (empty($fileArray) || isset($fileArray['name']) && $fileArray['name'] == '') {
             $this->t['errorfile'] = JText::_('COM_PHOCADOWNLOAD_PLEASE_ADD_FILE');
             $returnForm = 1;
         }
         if ($post['title'] == '') {
             $post['title'] = PhocaDownloadFile::removeExtension($fileArray['name']);
         }
         $post['alias'] = PhocaDownloadUtils::getAliasName($post['title']);
         if ($returnForm == 0) {
             $errorUploadMsg = '';
             if ($model->singleFileUpload($errorUploadMsg, $fileArray, $post)) {
                 if ($this->t['send_mail_upload'] > 0) {
                     PhocaDownloadMail::sendMail((int) $this->t['send_mail_upload'], $post['title'], 2);
                 }
                 $Itemid = $app->input->get('Itemid', 0, 'int');
                 $limitStart = $app->input->get('limitstart', 0, 'int');
                 if ($limitStart > 0) {
                     $limitStartUrl = '&limitstart=' . $limitStart;
                 } else {
                     $limitStartUrl = '';
                 }
                 $link = 'index.php?option=com_phocadownload&view=user&Itemid=' . $Itemid . $limitStartUrl;
                 $app->redirect(JRoute::_($link, false), JText::_("COM_PHOCADOWNLOAD_SUCCESS_FILE_UPLOADED"));
                 exit;
             } else {
                 $this->t['errorfile'] = JText::_('COM_PHOCADOWNLOAD_ERROR_FILE_UPLOADED');
                 if ($errorUploadMsg != '') {
                     $this->t['errorfile'] .= '<br />' . $errorUploadMsg;
                 }
             }
         }
     }
     // - - - - - - - - - - -
     // FILES
     // - - - - - - - - - - -
     $this->t['filesitems'] = $model->getDataFiles($user->id);
     $this->t['filestotal'] = $model->getTotalFiles($user->id);
     $this->t['filespagination'] = $model->getPaginationFiles($user->id);
     $filter_state_files = $app->getUserStateFromRequest($this->_context_files . '.filter_state', 'filter_state', '', 'word');
     $filter_catid_files = $app->getUserStateFromRequest($this->_context_files . '.filter_catid', 'filter_catid', 0, 'int');
     $catid_files = $app->getUserStateFromRequest($this->_context_files . '.catid', 'catid', 0, 'int');
     //$filter_sectionid_files	= $app->getUserStateFromRequest( $this->_context_files.'.filter_sectionid',	'filter_sectionid',	0,	'int' );
     $filter_order_files = $app->getUserStateFromRequest($this->_context_files . '.filter_order', 'filter_order', 'a.ordering', 'cmd');
     $filter_order_Dir_files = $app->getUserStateFromRequest($this->_context_files . '.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search_files = $app->getUserStateFromRequest($this->_context_files . '.search', 'search', '', 'string');
     $search_files = JString::strtolower($search_files);
     // build list of categories
     $javascript = 'class="inputbox" size="1" onchange="document.phocadownloadfilesform.submit();"';
     // get list of categories for dropdown filter
     $whereC = array();
     //if ($filter_sectionid_files > 0) {
     //	$whereC[] = ' cc.section = '.$db->Quote($filter_sectionid_files);
     //}
     //$whereC[]	= "(cc.uploaduserid LIKE '%-1%' OR cc.uploaduserid LIKE '%".(int)$user->id."%')";
     //$whereC[]	= "(cc.uploaduserid LIKE '%-1%' OR cc.uploaduserid LIKE '%,{".(int)$user->id."}' OR cc.uploaduserid LIKE '{".(int)$user->id."},%' OR cc.uploaduserid LIKE '%,{".(int)$user->id."},%' OR cc.uploaduserid ={".(int)$user->id."} )";
     $whereC[] = "(cc.uploaduserid LIKE '%-1%' OR cc.uploaduserid LIKE '%," . (int) $user->id . "' OR cc.uploaduserid LIKE '" . (int) $user->id . ",%' OR cc.uploaduserid LIKE '%," . (int) $user->id . ",%' OR cc.uploaduserid =" . (int) $user->id . " )";
     $whereC = count($whereC) ? ' WHERE ' . implode(' AND ', $whereC) : '';
     // get list of categories for dropdown filter
     $query = 'SELECT cc.id AS value, cc.title AS text, cc.parent_id as parentid' . ' FROM #__phocadownload_categories AS cc' . $whereC . ' ORDER BY cc.ordering';
     $lists_files['catid'] = PhocaDownloadCategory::filterCategory($query, $catid_files, TRUE, TRUE, TRUE);
     /*$whereS		= array();
     		//$whereS[]	= "(cc.uploaduserid LIKE '%-1%' OR cc.uploaduserid LIKE '%".(int)$user->id."%')";
     		$whereS[]	= "(cc.uploaduserid LIKE '%-1%' OR cc.uploaduserid LIKE '%,".(int)$user->id."' OR cc.uploaduserid LIKE '".(int)$user->id.",%' OR cc.uploaduserid LIKE '%,".(int)$user->id.",%' OR cc.uploaduserid =".(int)$user->id." )";
     		$whereS[]	= 's.published = 1';
     		$whereS 		= ( count( $whereS ) ? ' WHERE '. implode( ' AND ', $whereS ) : '' );
     		// sectionid
     		$query = 'SELECT s.title AS text, s.id AS value'
     		. ' FROM #__phocadownload_sections AS s'
     		. ' LEFT JOIN #__phocadownload_categories AS cc ON cc.section = s.id'
     		. $whereS
     		. ' GROUP BY s.id'
     		. ' ORDER BY s.ordering';
     		
     
     		
     		// state filter
     	/*	$state_files[] 		= JHTML::_('select.option',  '', '- '. JText::_( 'Select State' ) .' -' );
     		$state_files[] 		= JHTML::_('select.option',  'P', JText::_( 'Published' ) );
     		$state_files[] 		= JHTML::_('select.option',  'U', JText::_( 'Unpublished') );
     		$lists_image['state']	= JHTML::_('select.genericlist',   $state_files, 'filter_state', 'class="inputbox" size="1" onchange="document.phocadownloadfilesform.submit();"', 'value', 'text', $filter_state );*/
     //$lists_files['sectionid'] = PhocaDownloadCategory::filterSection($query, $filter_sectionid_files, TRUE);
     // state filter
     $lists_files['state'] = JHTML::_('grid.state', $filter_state_files);
     // table ordering
     $lists_files['order_Dir'] = $filter_order_Dir_files;
     $lists_files['order'] = $filter_order_files;
     // search filter
     $lists_files['search'] = $search_files;
     $this->t['catidfiles'] = $catid_files;
     $this->t['filestab'] = 1;
     // Tabs
     $displayTabs = 0;
     if ((int) $this->t['filestab'] == 0) {
         $currentTab['files'] = -1;
     } else {
         $currentTab['files'] = $displayTabs;
         $displayTabs++;
     }
     $this->t['displaytabs'] = $displayTabs;
     $this->t['currenttab'] = $currentTab;
     // ACTION
     $this->t['action'] = $uri->toString();
     // SEF problem
     $isThereQM = false;
     $isThereQM = preg_match("/\\?/i", $this->t['action']);
     if ($isThereQM) {
         $amp = '&amp;';
     } else {
         $amp = '?';
     }
     $this->t['actionamp'] = htmlspecialchars($this->t['action']) . $amp;
     $this->t['istheretab'] = false;
     $this->t['istheretab'] = preg_match("/tab=/i", $this->t['action']);
     $this->t['ps'] = '&tab=' . $this->t['currenttab']['files'] . '&limitstart=' . $this->t['filespagination']->limitstart;
     // ASIGN
     $this->assignRef('listsfiles', $lists_files);
     $this->assignRef('formdata', $formData);
     $this->assignRef('tmpl', $this->t);
     $this->assignRef('params', $this->t['p']);
     $session = JFactory::getSession();
     $this->assignRef('session', $session);
     parent::display($tpl);
 }
Beispiel #7
0
echo $r->startFilter();
echo $r->endFilter();

echo $r->startMainContainer();
echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL', $this->t['l'].'_FILTER_SEARCH_DESC',
							$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);

echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.state'));
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
echo $r->selectFilterCategory(PhocaDownloadCategory::options(1), $this->t['l'].'_FILTER_SELECT_TYPE', $this->state->get('filter.category_id'));
echo $r->endFilterBar();


echo $r->endFilterBar();		

echo $r->startTable('categoryList');

echo $r->startTblHeader();

echo $r->thOrdering('JGRID_HEADING_ORDERING', $listDirn, $listOrder);
echo $r->thCheck('JGLOBAL_CHECK_ALL');
echo '<th class="ph-title-short">'.JHTML::_('grid.sort',  	$this->t['l'].'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-filename-long">'.JHTML::_('grid.sort',  	$this->t['l'].'_FILENAME', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-published">'.JHTML::_('grid.sort',  $this->t['l'].'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-parentcattitle">'.JHTML::_('grid.sort', $this->t['l'].'_TYPE', 'a.type', $listDirn, $listOrder ).'</th>'."\n";
Beispiel #8
0
	echo '<div class="alert alert-error"><a class="close" data-dismiss="alert" href="#">&times;</a>'.JText::_($this->t['l'].'_NOT_APPROVED_FILES_COUNT').': '
	.(int)$this->tmpl['notapproved']->count.'</div>';
}

echo $r->startFilterBar();
echo $r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL', $this->t['l'].'_FILTER_SEARCH_DESC',
							$this->escape($this->state->get('filter.search')));
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);

echo $r->startFilterBar(2);
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.state'));
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
echo $r->selectFilterCategory(PhocaDownloadCategory::options($this->t['o']), 'JOPTION_SELECT_CATEGORY', $this->state->get('filter.category_id'));
echo $r->endFilterBar();

echo $r->endFilterBar();		

echo $r->startTable('categoryList');

echo $r->startTblHeader();

echo $r->thOrdering('JGRID_HEADING_ORDERING', $listDirn, $listOrder);
echo $r->thCheck('JGLOBAL_CHECK_ALL');
echo '<th class="ph-title">'.JHTML::_('grid.sort',  	$this->t['l'].'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-filename-long">'.JHTML::_('grid.sort',  	$this->t['l'].'_FILENAME', 'a.filename', $listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-published">'.JHTML::_('grid.sort',  $this->t['l'].'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";	
echo '<th class="ph-approved">'.JHTML::_('grid.sort',  	$this->t['l'].'_APPROVED', 'a.approved', $listDirn, $listOrder ).'</th>'."\n";
echo '<th class="ph-parentcattitle">'.JHTML::_('grid.sort', $this->t['l'].'_CATEGORY', 'category_id', $listDirn, $listOrder ).'</th>'."\n";
		
		if ($rightDisplay == 1) {
			
		
		
			// Test if we have information about category - if we are displaying items by e.g. search outcomes - tags
			// we don't have any ID of category so we need to load it for each file.
			$this->catitem[$v->id]			= new StdClass();
			$this->catitem[$v->id]->id 		= 0;
			$this->catitem[$v->id]->alias 	= '';
			
			if (isset($this->category[0]->id) && isset($this->category[0]->alias)) {
				$this->catitem[$v->id]->id 		= (int)$this->category[0]->id;
				$this->catitem[$v->id]->alias 	= $this->category[0]->alias;
			} else {
				$catDb = PhocaDownloadCategory::getCategoryByFile($v->id);
				if (isset($catDb->id) && isset($catDb->alias)) {
					$this->catitem[$v->id]->id 		= (int)$catDb->id;
					$this->catitem[$v->id]->alias 	= $catDb->alias;	
				}
				$categorySetTemp = 1;
				
			}
		
			// General
			$linkDownloadB = '';
			$linkDownloadE = '';
			if ((int)$v->confirm_license > 0 || $this->t['display_file_view'] == 1) {
				$linkDownloadB = '<a class="" href="'. JRoute::_(PhocaDownloadRoute::getFileRoute($v->id, $v->catid,$v->alias, $v->categoryalias, $v->sectionid). $this->t['limitstarturl']).'" >';	// we need pagination to go back			
				$linkDownloadE ='</a>';
			} else {
Beispiel #10
0
	public static function options($type = 0)
	{
		if ($type == 1) {
			$tree[0] 			= new JObject();
			$tree[0]->text 		= JText::_('COM_PHOCADOWNLOAD_MAIN_CSS');
			$tree[0]->value 	= 1;
			$tree[1] 			= new JObject();
			$tree[1]->text 		= JText::_('COM_PHOCADOWNLOAD_CUSTOM_CSS');
			$tree[1]->value 	= 2;
			return $tree;
		}
		
		$db = JFactory::getDBO();

       //build the list of categories
		$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid'
		. ' FROM #__phocadownload_categories AS a'
		. ' WHERE a.published = 1'
		. ' ORDER BY a.ordering';
		$db->setQuery( $query );
		$items = $db->loadObjectList();
	
		$catId	= -1;
		
		$javascript 	= 'class="inputbox" size="1" onchange="submitform( );"';
		
		$tree = array();
		$text = '';
		$tree = PhocaDownloadCategory::CategoryTreeOption($items, $tree, 0, $text, $catId);
		
		return $tree;

	}