Esempio n. 1
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $user = JFactory::getUser();
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     JToolbarHelper::title(JText::_('TRANSLATION_MANAGER'), 'article.png');
     JToolbarHelper::preferences('com_jalang');
     if (JalangHelper::isInstalled('com_flexicontent')) {
         JToolBarHelper::custom('tool.bindFLEXI', 'copy', '', JText::_('Transfer to FLEXI'));
     }
     if (JalangHelper::isJoomla3x()) {
         JHtmlSidebar::setAction('index.php?option=com_jalang&view=tool');
     }
 }
Esempio n. 2
0
require_once( __DIR__ . '/helpers/helper.php' );
require_once( __DIR__ . '/helpers/content/content.php' );
require_once( __DIR__ . '/helpers/translator/translator.php' );
*/
require_once dirname(__FILE__) . '/helpers/helper.php';
require_once dirname(__FILE__) . '/helpers/tool.php';
require_once dirname(__FILE__) . '/helpers/content/content.php';
require_once dirname(__FILE__) . '/helpers/translator/translator.php';
$app = JFactory::getApplication();
$helper = new JalangHelper();
$helper->update();
$itemtype = JRequest::getVar('itemtype', 'content');
if (!empty($itemtype)) {
    $app->setUserState('com_jalang.itemtype', $itemtype);
}
$mainlanguage = JRequest::getVar('mainlanguage', JalangHelper::getDefaultLanguage());
if (!empty($mainlanguage)) {
    $app->setUserState('com_jalang.mainlanguage', $mainlanguage);
}
//asset
$document = JFactory::getDocument();
if (JalangHelper::isJoomla3x()) {
    $document->addStyleSheet('components/com_jalang/asset/style.css');
} else {
    $document->addStyleSheet('components/com_jalang/asset/style_2x.css');
    $document->addScript('components/com_jalang/asset/jquery.min.js');
    $document->addScript('components/com_jalang/asset/jquery-noconflict.js');
}
$controller = JControllerLegacy::getInstance('Jalang');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
Esempio n. 3
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $user = JFactory::getUser();
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     JToolbarHelper::title(JText::_('TRANSLATION_MANAGER'), 'article.png');
     JToolbarHelper::preferences('com_jalang');
     if (JalangHelper::isJoomla3x()) {
         JHtmlSidebar::setAction('index.php?option=com_jalang&view=items');
     }
     $app = JFactory::getApplication();
     $itemtype = $app->getUserState('com_jalang.itemtype', 'content');
     $adapters = JalangHelperContent::getListAdapters();
     $options = array();
     $types = array();
     foreach ($adapters as $props) {
         $types[$props['name']] = $props['title'];
     }
     //Sort by Alphabet
     ksort($types);
     foreach ($types as $name => $title) {
         $options[] = JHtml::_('select.option', $name, $title);
     }
     $mainlanguage = $app->getUserState('com_jalang.mainlanguage', '*');
     if (JalangHelper::isJoomla3x()) {
         JHtmlSidebar::addFilter(JText::_('SELECT_ITEM_TYPE'), 'itemtype', JHtml::_('select.options', $options, 'value', 'text', $itemtype));
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'mainlanguage', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $mainlanguage));
     } else {
         $this->filterByItemtype = JHtml::_('select.options', $options, 'value', 'text', $itemtype);
         $this->filterByLanguage = JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $mainlanguage);
     }
 }