Exemplo n.º 1
0
 public function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('style');
     JHTML::stylesheet($this->t['s']);
     $this->state = $this->get('State');
     $this->item = $this->get('Item');
     $this->form = $this->get('Form');
     $this->ftp = JClientHelper::setCredentialsFromRequest('ftp');
     $model = $this->getModel();
     // Set CSS for codemirror
     JFactory::getApplication()->setUserState('editor.source.syntax', 'css');
     // New or edit
     if (!$this->form->getValue('id') || $this->form->getValue('id') == 0) {
         $this->form->setValue('source', null, '');
         $this->form->setValue('type', null, 2);
         $this->t['ssuffixtype'] = JText::_($this->t['l'] . '_WILL_BE_CREATED_FROM_TITLE');
     } else {
         $this->source = $model->getSource($this->form->getValue('id'), $this->form->getValue('filename'), $this->form->getValue('type'));
         $this->form->setValue('source', null, $this->source->source);
         $this->t['ssuffixtype'] = '';
     }
     // Only help input form field - to display Main instead of 1 and Custom instead of 2
     if ($this->form->getValue('type') == 1) {
         $this->form->setValue('typeoutput', null, JText::_($this->t['l'] . '_MAIN_CSS'));
     } else {
         $this->form->setValue('typeoutput', null, JText::_($this->t['l'] . '_CUSTOM_CSS'));
     }
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 2
0
 public function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('cat');
     $this->state = $this->get('State');
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $user = JFactory::getUser();
     $model = $this->getModel();
     JHTML::_('behavior.calendar');
     JHTML::stylesheet($this->t['s']);
     //Data from model
     //$this->item	=& $this->get('Data');
     $lists = array();
     $isNew = (int) $this->item->id == 0;
     // Edit or Create?
     if (!$isNew) {
         $model->checkout($user->get('id'));
     } else {
         // Initialise new record
         $this->item->approved = 1;
         $this->item->published = 1;
         $this->item->order = 0;
         $this->item->access = 0;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 3
0
 function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('cat');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     // Preprocess the list of items to find ordering divisions.
     foreach ($this->items as &$item) {
         $this->ordering[$item->parent_id][] = $item->id;
     }
     // We need to load all items because of creating tree
     // After creating tree we get info from pagination
     // and will set displaying of categories for current pagination
     //E.g. pagination is limitstart 5, limit 5 - so only categories from 5 to 10 will be displayed
     if (!empty($this->items)) {
         $text = '';
         // text is tree name e.g. Category >> Subcategory
         $tree = array();
         $this->items = $this->processTree($this->items, $tree, 0, $text, -1, 0);
     }
     //$this->tmpl['notapproved'] 	= $this->get( 'NotApprovedCategory' );
     JHTML::stylesheet($this->t['s']);
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 4
0
 public function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('lic');
     $this->state = $this->get('State');
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     JHTML::stylesheet($this->t['s']);
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 5
0
 function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars();
     JHTML::stylesheet($this->t['s']);
     JHTML::_('behavior.tooltip');
     $class = $this->t['n'] . 'Utils';
     $this->t['version'] = $class::getExtensionVersion();
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 6
0
 function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars();
     $this->views = array('files' => $this->t['l'] . '_FILES', 'cats' => $this->t['l'] . '_CATEGORIES', 'lics' => $this->t['l'] . '_LICENSES', 'stat' => $this->t['l'] . '_STATISTICS', 'downloads' => $this->t['l'] . '_DOWNLOADS', 'uploads' => $this->t['l'] . '_UPLOADS', 'rafile' => $this->t['l'] . '_FILE_RATING', 'tags' => $this->t['l'] . '_TAGS', 'layouts' => $this->t['l'] . '_LAYOUT', 'styles' => $this->t['l'] . '_STYLES', 'logs' => $this->t['l'] . '_LOGGING', 'info' => $this->t['l'] . '_INFO');
     JHTML::stylesheet($this->t['s']);
     JHTML::_('behavior.tooltip');
     $class = $this->t['n'] . 'Utils';
     $this->t['version'] = $class::getExtensionVersion();
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 7
0
	function display($tpl = null) {
	
		$this->t			= PhocaDownloadUtils::setVars('cat');
		
		$model 				= $this->getModel();
		$this->items		= $model->getItems();
		$this->pagination	= $model->getPagination();
		$this->state		= $model->getState();
		/*$this->items		= $this->get('Items');
		$this->pagination	= $this->get('Pagination');
		$this->state		= $this->get('State');*/
		
		// Preprocess the list of items to find ordering divisions.
		foreach ($this->items as &$item) {
			$this->ordering[$item->parent_id][] = $item->id;
		}
		
		// if search, don't do a tree, only display the searched items
		$this->t['search'] = $this->state->get('filter.search');
		// We need to load all items because of creating tree
		// After creating tree we get info from pagination
		// and will set displaying of categories for current pagination
		//E.g. pagination is limitstart 5, limit 5 - so only categories from 5 to 10 will be displayed
		
		// the same for max levels
		$this->t['level'] = $this->state->get('filter.level');
		
		if (!empty($this->items) && !$this->t['search']) {
			$text = ''; // text is tree name e.g. Category >> Subcategory
			$tree = array();
			
			// Filter max levels
			if (isset($this->t['level']) && $this->t['level'] > 0) {
				$maxLevel = (int)$this->t['level'] + 1;
			} else {
				$maxLevel = false;
			}
			
			$this->items = $this->processTree($this->items, $tree, 0, $text, -1, 0, '', $maxLevel);
			
			// Re count the pagination
			$countTotal 		= count($this->items);
			$model->setTotal($countTotal);
			$this->pagination	= $model->getPagination();
		}
		
		//$this->tmpl['notapproved'] 	= $this->get( 'NotApprovedCategory' );
		JHTML::stylesheet( $this->t['s'] );

		$this->addToolbar();
		parent::display($tpl);
	}
Exemplo n.º 8
0
 public function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('file');
     $this->state = $this->get('State');
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     JHTML::stylesheet($this->t['s']);
     if (isset($this->item->textonly) && (int) $this->item->textonly == 1 && JRequest::getVar('layout') != 'edit_text') {
         $tpl = 'text';
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 9
0
 function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('file');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     // Preprocess the list of items to find ordering divisions.
     foreach ($this->items as &$item) {
         $this->ordering[$item->catid][] = $item->id;
     }
     JHTML::stylesheet($this->t['s']);
     $this->tmpl['notapproved'] = $this->get('NotApprovedFile');
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 10
0
 function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('rafile');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     JHTML::stylesheet($this->t['s']);
     JHTML::stylesheet('media/com_phocadownload/css/administrator/rating.css');
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 11
0
 function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('upload');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     JHTML::stylesheet($this->t['s']);
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 12
0
 function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('lic');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     // Preprocess the list of items to find ordering divisions.
     foreach ($this->items as &$item) {
         $this->ordering[0][] = $item->id;
     }
     JHTML::stylesheet($this->t['s']);
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 13
0
 function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('style');
     $model = $this->getModel();
     $model->checkItems();
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     JHTML::stylesheet($this->t['s']);
     foreach ($this->items as &$item) {
         $this->ordering[$item->type][] = $item->id;
     }
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 14
0
 function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('stat');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->maxandsum = $this->get('MaxAndSum');
     foreach ($this->items as &$item) {
         if ($item->textonly == 0) {
             $this->ordering[0][] = $item->id;
         }
     }
     JHTML::stylesheet($this->t['s']);
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 15
0
 public function display($tpl = null)
 {
     $this->t = PhocaDownloadUtils::setVars('manager');
     $this->field = JRequest::getVar('field');
     $this->fce = 'phocaSelectFileName_' . $this->field;
     JHTML::stylesheet($this->t['s']);
     $this->folderstate = $this->get('FolderState');
     $this->files = $this->get('Files');
     $this->folders = $this->get('Folders');
     $this->session = JFactory::getSession();
     $this->manager = JRequest::getVar('manager', '', '', 'file');
     if ($this->manager == 'filemultiple') {
         $this->form = $this->get('Form');
     }
     $params = JComponentHelper::getParams($this->t['o']);
     $this->t['multipleuploadchunk'] = $params->get('multiple_upload_chunk', 0);
     $this->t['uploadmaxsize'] = $params->get('upload_maxsize', 3145728);
     $this->t['uploadmaxsizeread'] = PhocaDownloadFile::getFileSizeReadable($this->t['uploadmaxsize']);
     $this->t['enablemultiple'] = $params->get('enable_multiple_upload_admin', 0);
     $this->t['multipleuploadmethod'] = $params->get('multiple_upload_method', 1);
     $this->currentFolder = '';
     if (isset($this->folderstate->folder) && $this->folderstate->folder != '') {
         $this->currentFolder = $this->folderstate->folder;
     }
     // - - - - - - - - - -
     //TABS
     // - - - - - - - - - -
     $this->t['tab'] = JRequest::getVar('tab', '', '', 'string');
     $this->t['displaytabs'] = 0;
     // UPLOAD
     $this->t['currenttab']['upload'] = $this->t['displaytabs'];
     $this->t['displaytabs']++;
     // MULTIPLE UPLOAD
     if ((int) $this->t['enablemultiple'] >= 0) {
         $this->t['currenttab']['multipleupload'] = $this->t['displaytabs'];
         $this->t['displaytabs']++;
     }
     $group = PhocaDownloadSettings::getManagerGroup($this->manager);
     // - - - - - - - - - - -
     // Upload
     // - - - - - - - - - - -
     $sU = new PhocaDownloadFileUploadSingle();
     $sU->returnUrl = 'index.php?option=com_phocadownload&view=phocadownloadmanager&tab=upload' . str_replace('&', '&', $group['c']) . '&manager=' . $this->manager . '&field=' . $this->field . '&folder=' . $this->currentFolder;
     $sU->tab = 'upload';
     $this->t['su_output'] = $sU->getSingleUploadHTML();
     $this->t['su_url'] = JURI::base() . 'index.php?option=com_phocadownload&task=phocadownloadupload.upload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&viewback=phocadownloadmanager&manager=' . $this->manager . '&field=' . $this->field . '&' . 'folder=' . $this->currentFolder . '&tab=upload';
     // - - - - - - - - - - -
     // Multiple Upload
     // - - - - - - - - - - -
     // Get infos from multiple upload
     $muFailed = JRequest::getVar('mufailed', '0', '', 'int');
     $muUploaded = JRequest::getVar('muuploaded', '0', '', 'int');
     $this->t['mu_response_msg'] = $muUploadedMsg = '';
     if ($muUploaded > 0) {
         $muUploadedMsg = JText::_('COM_PHOCADOWNLOAD_COUNT_UPLOADED_FILE') . ': ' . $muUploaded;
     }
     if ($muFailed > 0) {
         $muFailedMsg = JText::_('COM_PHOCADOWNLOAD_COUNT_NOT_UPLOADED_FILE') . ': ' . $muFailed;
     }
     if ($muFailed > 0 && $muUploaded > 0) {
         $this->t['mu_response_msg'] = '<div class="alert alert-info">' . '<button type="button" class="close" data-dismiss="alert">&times;</button>' . JText::_('COM_PHOCADOWNLOAD_COUNT_UPLOADED_FILE') . ': ' . $muUploaded . '<br />' . JText::_('COM_PHOCADOWNLOAD_COUNT_NOT_UPLOADED_FILE') . ': ' . $muFailed . '</div>';
     } else {
         if ($muFailed > 0 && $muUploaded == 0) {
             $this->t['mu_response_msg'] = '<div class="alert alert-error">' . '<button type="button" class="close" data-dismiss="alert">&times;</button>' . JText::_('COM_PHOCADOWNLOAD_COUNT_NOT_UPLOADED_FILE') . ': ' . $muFailed . '</div>';
         } else {
             if ($muFailed == 0 && $muUploaded > 0) {
                 $this->t['mu_response_msg'] = '<div class="alert alert-success">' . '<button type="button" class="close" data-dismiss="alert">&times;</button>' . JText::_('COM_PHOCADOWNLOAD_COUNT_UPLOADED_FILE') . ': ' . $muUploaded . '</div>';
             } else {
                 $this->t['mu_response_msg'] = '';
             }
         }
     }
     if ((int) $this->t['enablemultiple'] >= 0) {
         PhocadownloadFileUploadMultiple::renderMultipleUploadLibraries();
         $mU = new PhocaDownloadFileUploadMultiple();
         $mU->frontEnd = 0;
         $mU->method = $this->t['multipleuploadmethod'];
         $mU->url = JURI::base() . 'index.php?option=com_phocadownload&task=phocadownloadupload.multipleupload&amp;' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&tab=multipleupload&manager=' . $this->manager . '&field=' . $this->field . '&folder=' . $this->currentFolder;
         $mU->reload = JURI::base() . 'index.php?option=com_phocadownload&view=phocadownloadmanager' . str_replace('&amp;', '&', $group['c']) . '&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&tab=multipleupload&' . 'manager=' . $this->manager . '&field=' . $this->field . '&folder=' . $this->currentFolder;
         $mU->maxFileSize = PhocadownloadFileUploadMultiple::getMultipleUploadSizeFormat($this->t['uploadmaxsize']);
         $mU->chunkSize = '1mb';
         $mU->renderMultipleUploadJS(0, $this->t['multipleuploadchunk']);
         $this->t['mu_output'] = $mU->getMultipleUploadHTML();
     }
     $this->t['ftp'] = !JClientHelper::hasCredentials('ftp');
     $this->t['path'] = PhocaDownloadPath::getPathSet($this->manager);
     $this->addToolbar();
     parent::display($tpl);
     echo JHTML::_('behavior.keepalive');
 }