Example #1
0
 function display($tpl = null)
 {
     //initialise variables
     $document =& JFactory::getDocument();
     $user =& JFactory::getUser();
     $uri =& JFactory::getURI();
     //add css and submenu to document
     $document->addStyleSheet('components/com_missingt/assets/css/missingt.css');
     $document->setTitle(JText::_('COM_MISSINGT_VIEW_COMPONENTS_TITLE'));
     //build toolbar
     JToolBarHelper::title(JText::_('COM_MISSINGT_VIEW_COMPONENTS_TITLE'), 'missingt');
     JToolBarHelper::custom('parse', 'parse', 'parse', JText::_("COM_MISSINGT_TRANSLATE_FILE_TOOLBAR_PARSE"), true);
     MissingtAdminHelper::buildMenu();
     $state =& $this->get('State');
     $search = $state->get('search', '');
     $items =& $this->get('Data');
     $total =& $this->get('Total');
     $pagination =& $this->get('Pagination');
     $lists = array();
     $lists['search'] = $search;
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('lists', $lists);
     parent::display($tpl);
 }
Example #2
0
 function display($tpl = null)
 {
     global $option, $mainframe;
     //Load pane behavior
     jimport('joomla.html.pane');
     //initialise variables
     $document =& JFactory::getDocument();
     $pane =& JPane::getInstance('sliders');
     $user =& JFactory::getUser();
     $uri =& JFactory::getURI();
     //add css and submenu to document
     $document->addStyleSheet('components/com_missingt/assets/css/missingt.css');
     //build toolbar
     JToolBarHelper::title(JText::_('COM_MISSINGT_VIEW_TRANSLATIONS_TITLE'), 'missingt');
     JToolBarHelper::custom('translate', 'forward.png', 'forward.png', JText::_('COM_MISSINGT_FILES_TOOLBAR_TRANSLATE'), true, true);
     JToolBarHelper::custom('history', 'history', 'history', JText::_('COM_MISSINGT_FILES_TOOLBAR_HISTORY'), true, true);
     JToolBarHelper::help('missingt.main', true);
     MissingtAdminHelper::buildMenu();
     $document->setTitle(JText::_('COM_MISSINGT_VIEW_TRANSLATIONS_TITLE'));
     $rows =& $this->get('Data');
     $languages_src =& $this->get('Languages');
     $total =& $this->get('Total');
     $pagination =& $this->get('Pagination');
     $filter_order = $mainframe->getUserState($option . '.files.filter_order', 'filter_order', 'name', 'cmd');
     $filter_order_Dir = $mainframe->getUserState($option . '.files.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserState($option . '.files.search', 'search', '', 'string');
     $from = $mainframe->getUserState($option . '.files.from');
     $to = $mainframe->getUserState($option . '.files.to');
     $type = $mainframe->getUserState($option . '.files.location');
     // lists
     $lists = array();
     // source languages
     $options = array();
     foreach ($languages_src as $src) {
         $options[] = JHTML::_('select.option', $src, $src);
     }
     $lists['from'] = JHTML::_('select.genericlist', $options, 'from', 'class="lg-refresh"', 'value', 'text', $from);
     $lists['to'] = JHTML::_('select.genericlist', $options, 'to', 'class="lg-refresh"', 'value', 'text', $to);
     $options = array();
     $options[] = JHTML::_('select.option', 'frontend', JText::_('COM_MISSINGT_VIEW_FILES_FRONTEND'));
     $options[] = JHTML::_('select.option', 'backend', JText::_('COM_MISSINGT_VIEW_FILES_BACKEND'));
     $lists['location'] = JHTML::_('select.genericlist', $options, 'location', 'class="lg-refresh"', 'value', 'text', $type);
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $this->assignRef('user', JFactory::getUser());
     $this->assignRef('items', $rows);
     $this->assignRef('lists', $lists);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('request_url', $uri->toString());
     $this->assign('from', $from);
     $this->assign('to', $to);
     parent::display($tpl);
 }
Example #3
0
 function display($tpl = null)
 {
     //Load pane behavior
     jimport('joomla.html.pane');
     //initialise variables
     $document =& JFactory::getDocument();
     $pane =& JPane::getInstance('sliders');
     $user =& JFactory::getUser();
     MissingtAdminHelper::buildMenu();
     //build toolbar
     JToolBarHelper::title(JText::_('COM_MISSINGT_VIEW_CPANEL_TITLE'), 'missingt');
     JToolBarHelper::preferences('com_Missingt', '360');
     JToolBarHelper::help('missingt.main', true);
     //add css and submenu to document
     $document->addStyleSheet('components/com_missingt/assets/css/missingt.css');
     //assign vars to the template
     $this->assignRef('pane', $pane);
     $this->assignRef('user', $user);
     parent::display($tpl);
 }
Example #4
0
 /**
  * save translatio to file
  * 
  */
 function save()
 {
     $cid = JRequest::getVar('cid', array(), 'post', 'array');
     $cid = $cid[0];
     $post = MissingtAdminHelper::getRealPOST();
     // message type for redirect
     $type = 'message';
     $model = $this->getModel('file');
     if ($model->store($post)) {
         $msg = JText::_('COM_MISSINGT_FILE_SAVED_SUCCESS');
     } else {
         $msg = JText::_('COM_MISSINGT_FILE_SAVED_FAILURE') . $model->getError();
         $type = 'error';
     }
     if ($this->getTask() == 'save') {
         $link = 'index.php?option=com_missingt&view=files';
     } else {
         $link = 'index.php?option=com_missingt&controller=files&task=translate&cid[]=' . $cid . '&from=' . JRequest::getVar('from') . '&to=' . JRequest::getVar('to') . '&location=' . JRequest::getVar('location');
     }
     $this->setRedirect($link, $msg, $type);
     $this->redirect();
 }
Example #5
0
 /**
  * loads the language file into _currentLang
  */
 protected function _loadLangFile()
 {
     jimport('joomla.filesystem.file');
     switch ($this->getLocation()) {
         case 'admin':
             $file = JPATH_ADMINISTRATOR . DS . 'language' . DS . 'en-GB' . DS . 'en-GB.' . $this->_id . '.ini';
             break;
         case 'site':
             $file = JPATH_SITE . DS . 'language' . DS . 'en-GB' . DS . 'en-GB.' . $this->_id . '.ini';
             break;
     }
     if (JFile::exists($file)) {
         MissingtAdminHelper::checkHistory($file);
         $this->_data = MissingTLine::iniStringToArray(file_get_contents($file));
     }
 }
Example #6
0
 function getResult()
 {
     $post = MissingtAdminHelper::getRealPOST();
     $text = $this->_convertToIni($post);
     return $text;
 }