• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JoomFishManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中JoomFishManager的典型用法代码示例。如果您正苦于以下问题:PHP JoomFishManager类的具体用法?PHP JoomFishManager怎么用?PHP JoomFishManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了JoomFishManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: jflanguagesType

 function jflanguagesType()
 {
     $this->values = array();
     if (ACYMAILING_J16 && file_exists(JPATH_SITE . DS . 'libraries' . DS . 'joomfish' . DS . 'manager.php') || !ACYMAILING_J16 && file_exists(JPATH_SITE . DS . 'administrator' . DS . 'components' . DS . 'com_joomfish' . DS . 'classes' . DS . 'JoomfishManager.class.php')) {
         include_once JPATH_SITE . DS . 'components' . DS . 'com_joomfish' . DS . 'helpers' . DS . 'defines.php';
         if (!ACYMAILING_J16) {
             include_once JOOMFISH_ADMINPATH . DS . 'classes' . DS . 'JoomfishManager.class.php';
         } else {
             include_once JPATH_SITE . DS . 'libraries' . DS . 'joomfish' . DS . 'manager.php';
         }
         $jfManager = JoomFishManager::getInstance();
         $langActive = $jfManager->getActiveLanguages();
         $this->values[] = JHTML::_('select.option', '', JText::_('DEFAULT_LANGUAGE'));
         foreach ($langActive as $oneLanguage) {
             $this->values[] = JHTML::_('select.option', $oneLanguage->shortcode . ',' . $oneLanguage->id, $oneLanguage->name);
         }
         $this->found = true;
     }
     if (empty($this->values) && file_exists(JPATH_SITE . DS . 'components' . DS . 'com_falang' . DS . 'helpers' . DS . 'defines.php') && (include_once JPATH_SITE . DS . 'components' . DS . 'com_falang' . DS . 'helpers' . DS . 'defines.php')) {
         JLoader::register('FalangManager', FALANG_ADMINPATH . '/classes/FalangManager.class.php');
         $fManager = FalangManager::getInstance();
         $langActive = $fManager->getActiveLanguages();
         $this->values[] = JHTML::_('select.option', '', JText::_('DEFAULT_LANGUAGE'));
         foreach ($langActive as $oneLanguage) {
             $this->values[] = JHTML::_('select.option', $oneLanguage->lang_code . ',' . $oneLanguage->lang_id, $oneLanguage->title);
         }
         $this->found = true;
     }
 }
开发者ID:juanferden,项目名称:adoperp,代码行数:29,代码来源:jflanguages.php


示例2: __construct

 /**
  * Constructor for the tasker
  *
  * @return joomfishTasker
  */
 public function __construct()
 {
     parent::__construct();
     $this->registerDefaultTask('show');
     $this->act = JRequest::getVar('act', '');
     $this->task = JRequest::getVar('task', '');
     $this->cid = JRequest::getVar('cid', array(0));
     if (!is_array($this->cid)) {
         $this->cid = array(0);
     }
     $this->fileCode = JRequest::getVar('fileCode', '');
     $this->_joomfishManager = JoomFishManager::getInstance();
     $this->registerTask('show', 'showCElementConfig');
     $this->registerTask('detail', 'showElementConfiguration');
     $this->registerTask('remove', 'removeContentElement');
     $this->registerTask('remove_install', 'removeContentElement');
     $this->registerTask('installer', 'showContentElementsInstaller');
     $this->registerTask('uploadfile', 'installContentElement');
     // Populate data used by controller
     global $mainframe;
     $this->_catid = $mainframe->getUserStateFromRequest('selected_catid', 'catid', '');
     $this->_select_language_id = $mainframe->getUserStateFromRequest('selected_lang', 'select_language_id', '-1');
     $this->_language_id = JRequest::getVar('language_id', $this->_select_language_id);
     $this->_select_language_id = $this->_select_language_id == -1 && $this->_language_id != -1 ? $this->_language_id : $this->_select_language_id;
     // Populate common data used by view
     // get the view
     $this->view = $this->getView("elements");
     // Assign data for view
     $this->view->assignRef('catid', $this->_catid);
     $this->view->assignRef('select_language_id', $this->_select_language_id);
     $this->view->assignRef('task', $this->task);
     $this->view->assignRef('act', $this->act);
 }
开发者ID:JoomFish,项目名称:joomfish-2.2,代码行数:38,代码来源:elements.php


示例3: getOptions

 /**
  * Method to get the field options for content languages.
  *
  * @return  array  The field option objects.
  *
  * @since   11.1
  */
 protected function getOptions()
 {
     $basicoptions = JHtml::_('contentlanguage.existing');
     // set default
     if (!isset($this->value) || empty($this->value) || $this->value == '*') {
         $jfManager = JoomFishManager::getInstance();
         $this->value = $jfManager->getDefaultLanguage();
     }
     return $basicoptions;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:17,代码来源:contentlanguage.php


示例4: getComponentMapping

 public static function getComponentMapping($modulParam)
 {
     $retVal = array();
     $jfm = JoomFishManager::getInstance();
     $contentElements = $jfm->getContentElements();
     foreach ($contentElements as $element) {
         $componentinfo = $element->getComponentInformation();
         $retVal = array_merge($retVal, $componentinfo);
     }
     return $retVal;
 }
开发者ID:JoomFish,项目名称:joomfish-2.2,代码行数:11,代码来源:helper.php


示例5: jflanguagesType

 function jflanguagesType()
 {
     $this->values = array();
     if (@(include_once JPATH_SITE . DS . 'components' . DS . 'com_joomfish' . DS . 'helpers' . DS . 'defines.php')) {
         include_once JOOMFISH_ADMINPATH . DS . 'classes' . DS . 'JoomfishManager.class.php';
         $jfManager = JoomFishManager::getInstance();
         $langActive = $jfManager->getActiveLanguages();
         $this->values[] = JHTML::_('select.option', '', JText::_('DEFAULT_LANGUAGE'));
         foreach ($langActive as $oneLanguage) {
             $this->values[] = JHTML::_('select.option', $oneLanguage->shortcode . ',' . $oneLanguage->id, $oneLanguage->name);
         }
     }
 }
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:13,代码来源:jflanguages.php


示例6: jfGetOtherLanguages

function jfGetOtherLanguages()
{
    // inspired by modules/mod_jflanguageselection
    $jfManager = JoomFishManager::getInstance();
    $jfrouter = JFRoute::getInstance();
    $curLang = jfGetCurrentLanguage();
    $languages = array();
    foreach ($jfManager->getActiveLanguages(true) as $lang) {
        if ($lang->lang_code != $curLang->lang_code) {
            $code = $lang->getLanguageCode();
            $languages[$code] = $jfrouter->rerouteCurrentUrl($code);
        }
    }
    return $languages;
}
开发者ID:xi,项目名称:kub-template,代码行数:15,代码来源:functions.php


示例7: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   11.1
  */
 protected function getOptions()
 {
     // Initialize some field attributes.
     $client = (string) $this->element['client'];
     if ($client != 'site' && $client != 'administrator') {
         $client = 'site';
     }
     // set default
     if (!isset($this->value) || empty($this->value) || $this->value == '*') {
         $jfManager = JoomFishManager::getInstance();
         $this->value = $jfManager->getDefaultLanguage();
     }
     // Merge any additional options in the XML definition.
     $options = JLanguageHelper::createLanguageList($this->value, constant('JPATH_' . strtoupper($client)), true, true);
     return $options;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:23,代码来源:language.php


示例8: onAfterInitialise

 function onAfterInitialise()
 {
     $mainframe =& JFactory::getApplication();
     JFactory::getConfig()->set('sef_suffix', 0);
     // Store J! router for later use
     $router =& $mainframe->getRouter();
     $mainframe->set('mijosef.global.jrouter', $router);
     // Activate MijoSEF router
     $mijosef_router = new JRouterMijosef();
     $router->attachParseRule(array($mijosef_router, 'parse'));
     $router->attachBuildRule(array($mijosef_router, 'build'));
     // Instantiate JoomFishManager before JFDatabase loading to prevent infinity loop...
     if (Mijosef::get('utility')->JoomFishInstalled() && class_exists('JoomFishManager')) {
         JoomFishManager::getInstance();
     }
     // Post varsa yönlendirme
     $post = JRequest::get('post');
     if (is_array($post) && !empty($post)) {
         return;
     }
     // Ajax durumunda yönlendirme yapma
     $tmpl = JRequest::getCmd('tmpl');
     $format = JRequest::getCmd('format');
     if ($tmpl == 'component' || $format == 'raw') {
         return;
     }
     // www settings
     $uri =& JFactory::getURI();
     $host =& $uri->getHost();
     $redirect = false;
     $wwwredirect = $this->MijosefConfig->redirect_to_www;
     if ($wwwredirect != 0) {
         if ($wwwredirect == 1 && strpos($host, 'www') !== 0) {
             $redirect = true;
             $uri->setHost('www.' . $host);
         } elseif ($wwwredirect == 2 && strpos($host, 'www') === 0) {
             $redirect = true;
             $uri->setHost(substr($host, 4, strlen($host)));
         }
     }
     if ($redirect === true) {
         $mainframe->redirect($uri->toString());
         $mainframe->close();
     }
 }
开发者ID:affiliatelk,项目名称:ecc,代码行数:45,代码来源:plugin.php


示例9: getMenus

 /**
  * Get a list of the available menus.
  *
  * @return	array	An array of the available menus (from the menu types table).
  * @since	1.6
  */
 public static function getMenus()
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('a.*, SUM(b.home) AS home');
     $query->from('#__menu_types AS a');
     $query->leftJoin('#__menu AS b ON b.menutype = a.menutype AND b.home != 0 AND (b.language=\'*\' OR b.language=\'' . JoomFishManager::getDefaultLanguage() . '\')');
     $query->select('b.language');
     $query->leftJoin('#__languages AS l ON l.lang_code = language');
     $query->select('l.image');
     $query->select('l.sef');
     $query->select('l.title_native');
     $query->where('(b.client_id = 0 OR b.client_id IS NULL)');
     //sqlsrv change
     $query->group('a.id, a.menutype, a.description, a.title, b.menutype,b.language,l.image,l.sef,l.title_native');
     $db->setQuery($query);
     $result = $db->loadObjectList();
     return $result;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:25,代码来源:adminmenuhelper.php


示例10: __construct

 /**
  * PHP 4 constructor for the tasker
  *
  * @return joomfishTasker
  */
 function __construct()
 {
     parent::__construct();
     $this->registerDefaultTask('showTranslate');
     $this->act = JRequest::getVar('act', '');
     $this->task = JRequest::getVar('task', '');
     $this->cid = JRequest::getVar('cid', array(0));
     if (!is_array($this->cid)) {
         $this->cid = array(0);
     }
     $this->fileCode = JRequest::getVar('fileCode', '');
     $this->_joomfishManager =& JoomFishManager::getInstance();
     $this->registerTask('overview', 'showTranslate');
     $this->registerTask('edit', 'editTranslation');
     $this->registerTask('apply', 'saveTranslation');
     $this->registerTask('save', 'saveTranslation');
     $this->registerTask('publish', 'publishTranslation');
     // NB the method will check on task
     $this->registerTask('unpublish', 'publishTranslation');
     $this->registerTask('remove', 'removeTranslation');
     $this->registerTask('preview', 'previewTranslation');
     $this->registerTask('orphans', 'showOrphanOverview');
     $this->registerTask('orphandetail', 'showOrphanDetail');
     $this->registerTask('removeorphan', 'removeOrphan');
     // Populate data used by controller
     global $mainframe;
     $this->_catid = $mainframe->getUserStateFromRequest('selected_catid', 'catid', '');
     $this->_select_language_id = $mainframe->getUserStateFromRequest('selected_lang', 'select_language_id', '-1');
     $this->_language_id = JRequest::getVar('language_id', $this->_select_language_id);
     $this->_select_language_id = $this->_select_language_id == -1 && $this->_language_id != -1 ? $this->_language_id : $this->_select_language_id;
     // Populate common data used by view
     // get the view
     $this->view =& $this->getView("translate");
     $model =& $this->getModel('translate');
     $this->view->setModel($model, true);
     // Assign data for view
     $this->view->assignRef('catid', $this->_catid);
     $this->view->assignRef('select_language_id', $this->_select_language_id);
     $this->view->assignRef('task', $this->task);
     $this->view->assignRef('act', $this->act);
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:46,代码来源:translate.php


示例11: JreviewsParseRoute

function JreviewsParseRoute($segments)
{
    $vars = array();
    # Load own uri to overcome Joomla encoding issues with Greek params
    $uri = cmsFramework::_getUri();
    // Fix for Joomfish. Remove the language segment from the url
    if (class_exists('JoomFishManager')) {
        $lang = JFactory::getLanguage();
        $language = $lang->getTag();
        $jfm = JoomFishManager::getInstance();
        $lang_shortcode = $jfm->getLanguageCode($language);
        if (strstr($uri, '/' . $lang_shortcode . '/')) {
            $uri = str_replace('/' . $lang_shortcode . '/', '/', $uri);
        }
    }
    $new_segments = cmsFramework::_parseSefRoute($uri);
    if (end($new_segments) == 'index.php') {
        $new_segments = $segments;
    }
    // Remove Joomla language segment from url
    if (isset($_GET['language']) && $_GET['language'] != '' && strlen($new_segments[0]) == 2) {
        $new_segments[0] = 'index.php';
    }
    # Fix for sef without mod rewrite. Without it the sort urls don't work.
    // Remove the Itemid related segments when mod rewrite is disabled and Itemid exists
    if ($new_segments[0] == 'index.php' && $new_segments[1] != 'component') {
        foreach ($new_segments as $key => $segment) {
            if (!in_array(str_replace(' ', '+', $segment), $segments) && !in_array(JreviewsStrReplaceOnce('-', ':', urlencode($segment)), $segments)) {
                unset($new_segments[$key]);
            }
        }
    }
    if (count($new_segments) >= 3 && isset($new_segments[0]) && $new_segments[0] == 'index.php' && isset($new_segments[1]) && $new_segments[1] == 'component' && isset($new_segments[2]) && $new_segments[2] == 'jreviews') {
        array_shift($new_segments);
        array_shift($new_segments);
        array_shift($new_segments);
    }
    $vars['url'] = implode('/', $new_segments);
    return $vars;
}
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:40,代码来源:router.php


示例12: getTranslateParams

 public static function getTranslateParams($type = '', $original, $translation, $fieldname, $fields = null)
 {
     JoomFishManager::addIncludePath(JOOMFISH_LIBPATH . DS . 'translateparams', 'translateparams');
     JoomFishManager::addIncludePath(JOOMFISH_LIBPATH . DS . 'contentelement' . DS . 'contentelements', 'translateparams');
     $paramsclass = "TranslateParams_" . $type;
     if (!class_exists($paramsclass)) {
         // Search for the class file in the include paths.
         jimport('joomla.filesystem.path');
         if ($path = JPath::find(JoomFishManager::addIncludePath('', 'translateparams'), strtolower($type) . '.php')) {
             include_once $path;
         } else {
             if ($path = JPath::find(JoomFishManager::addIncludePath('', 'translateparams'), $paramsclass . '.php')) {
                 include_once $path;
             }
         }
     }
     if (!class_exists($paramsclass)) {
         jimport('joomfish.translateparams.translateparams');
         $paramsclass = "TranslateParams";
     }
     return new $paramsclass($original, $translation, $fieldname, $fields);
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:22,代码来源:translateparams.php


示例13: _removeTranslation

 /**
  * Deletes the selected translations (only the translations of course)
  * @return string	message
  */
 function _removeTranslation($catid, $cid)
 {
     $message = '';
     $db = JFactory::getDBO();
     foreach ($cid as $cid_row) {
         list($translationid, $contentid, $language_id) = explode('|', $cid_row);
         $jfManager = JoomFishManager::getInstance();
         $contentElement = $jfManager->getContentElement($catid);
         $contentTable = $contentElement->getTableName();
         $contentid = intval($contentid);
         $translationid = intval($translationid);
         // safety check -- complete overkill but better to be safe than sorry
         // get the translation details
         JLoader::import('models.JFContent', JOOMFISH_ADMINPATH);
         $translation = new jfContent($db);
         $translation->load($translationid);
         if (!isset($translation) || $translation->id == 0) {
             $this->setState('message', JText::sprintf('NO_SUCH_TRANSLATION', $translationid));
             continue;
         }
         // make sure translation matches the one we wanted
         if ($contentid != $translation->reference_id) {
             $this->setState('message', JText::_('Something dodgy going on here'));
             continue;
         }
         $sql = "DELETE from #__jf_content WHERE reference_table='{$catid}' and language_id={$language_id} and reference_id={$contentid}";
         $db->setQuery($sql);
         $db->query();
         if ($db->getErrorNum() != 0) {
             $this->setError(JText::_('Something dodgy going on here'));
             JError::raiseWarning(400, JTEXT::_('No valid table information: ') . $db->getErrorMsg());
             continue;
         } else {
             $this->setState('message', JText::_('Translation successfully deleted'));
         }
     }
     return $message;
 }
开发者ID:RangerWalt,项目名称:ecci,代码行数:42,代码来源:translate.php


示例14: _setupContentElementCache

 /**
  * Sets up ContentElement Cache - mainly used for data to determine primary key id for tablenames ( and for
  * future use to allow tables to be dropped from translation even if contentelements are installed )
  */
 function _setupContentElementCache()
 {
     $db =& JFactory::getDBO();
     // Make usre table exists otherwise create it.
     $db->setQuery("CREATE TABLE IF NOT EXISTS `#__jf_tableinfo` ( `id` int(11) NOT NULL auto_increment, `joomlatablename` varchar(100) NOT NULL default '',  `tablepkID`  varchar(100) NOT NULL default '', PRIMARY KEY (`id`)) TYPE=MyISAM");
     $db->query();
     // clear out existing data
     $db->setQuery("DELETE FROM `#__jf_tableinfo`");
     $db->query();
     $joomfishManager =& JoomFishManager::getInstance();
     $contentElements = $joomfishManager->getContentElements(true);
     $sql = "INSERT INTO `#__jf_tableinfo` (joomlatablename,tablepkID) VALUES ";
     $firstTime = true;
     foreach ($contentElements as $contentElement) {
         $tablename = $contentElement->getTableName();
         $refId = $contentElement->getReferenceID();
         $sql .= $firstTime ? "" : ",";
         $sql .= " ('" . $tablename . "', '" . $refId . "')";
         $firstTime = false;
     }
     $db->setQuery($sql);
     $db->query();
 }
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:27,代码来源:controllerHelper.php


示例15: _plgListingAfterSave

 function _plgListingAfterSave(&$model)
 {
     // Limit running this for new/edited listings. Not deletion of images or other listing actions.
     if ($this->c->name == 'listings' && in_array($this->c->action, array('_save'))) {
         include_once PATH_ROOT . 'administrator' . DS . 'components' . DS . 'com_joomfish' . DS . 'models' . DS . 'ContentObject.php';
         $lang =& JFactory::getLanguage();
         $language = $lang->getTag();
         $jfm =& JoomFishManager::getInstance();
         $contentElement = $jfm->getContentElement('content');
         $actContentObject = new ContentObject($jfm->getLanguageID($language), $contentElement);
         $object = (object) $model->data['Listing'];
         $actContentObject->loadFromContentID($object->id);
         $actContentObject->copyContentToTranslation($object, $object);
         $actContentObject->setPublished($this->autoPublishTranslation);
         //Automatically publishes the translations
         $actContentObject->store();
         if ($jfm->getCfg("transcaching", 1)) {
             // clean the cache!
             $cache = $jfm->getCache($language);
             $cache->clean();
         }
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:23,代码来源:joomfish.php


示例16: getInput

 public function getInput()
 {
     if (JPath::find(JPATH_SITE . DS . 'components' . DS . 'com_joomfish' . DS . 'helpers', 'defines.php')) {
         require_once JPATH_SITE . DS . 'components' . DS . 'com_joomfish' . DS . 'helpers' . DS . 'defines.php';
         jimport('joomfish.manager');
     } else {
         JError::raiseNotice('no_jf_component', JText::_('Joom!Fish component not installed correctly. Plugin not executed'));
     }
     $jfm = JoomFishManager::getInstance();
     $activeLanguages = $jfm->getLanguagesIndexedById();
     $value = $this->value;
     if (!is_array($value)) {
         $default = "";
         $value = array();
         foreach ($activeLanguages as $key => $val) {
             $value[$key] = $val->lang_id . "::" . $default . $val->sef;
         }
     }
     $indexedvalues = array();
     foreach ($value as $val) {
         list($key, $val) = explode("::", $val, 2);
         $indexedvalues[$key] = $val;
     }
     $html = "<fieldset style='clear:left'><table>";
     $html .= "<tr style='font-weight:bold;'><td>" . JText::_('JFIELD_LANGUAGE_LABEL') . "</td><td>" . JText::_('JFIELD_LANGUAGE_LABEL') . "</td></tr>";
     foreach ($activeLanguages as $key => $val) {
         $html .= "<tr>";
         $html .= '<td>' . $val->name . '</td><td>';
         $prefix = array_key_exists($val->lang_id, $indexedvalues) ? $indexedvalues[$val->lang_id] : "lang-" . $val->sef;
         $idprefix = $val->lang_id . "::" . $prefix;
         $html .= "<input type='text' length='10' maxlength='50' id='sefprefix" . $val->lang_id . "' onblur='document.getElementById(\"hiddensefprefix" . $val->lang_id . "\").value=\"" . $val->lang_id . "::\"+this.value;' value='" . $prefix . "' />";
         $html .= "<input type='hidden' id='hiddensefprefix" . $val->lang_id . "' name='" . $this->name . "[]' value='" . $idprefix . "' />";
         $html .= "</td></tr>";
     }
     $html .= "</table></fieldset>";
     return $html;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:37,代码来源:sefprefix.php


示例17: bind

 /**
  * Overloaded bind function
  *
  * @param   array  $array   Named array
  * @param   mixed  $ignore  An optional array or space separated list of properties to ignore while binding.
  *
  * @return  mixed  Null if operation was satisfactory, otherwise returns an error
  *
  * @see     JTable::bind
  * @since   11.1
  */
 public function bind($array, $ignore = '')
 {
     // Verify that the default home menu is not unset
     if ($this->home == '1' && ($this->language == '*' || $this->language == JoomFishManager::getDefaultLanguage()) && $array['home'] == '0') {
         $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT_DEFAULT'));
         return false;
     }
     //Verify that the default home menu set to "all" languages" is not unset
     if ($this->home == '1' && ($this->language == '*' || $this->language == JoomFishManager::getDefaultLanguage()) && $array['language'] != '*' && $array['language'] != JoomFishManager::getDefaultLanguage()) {
         $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT'));
         return false;
     }
     // Verify that the default home menu is not unpublished
     if ($this->home == '1' && ($this->language == '*' || $this->language == JoomFishManager::getDefaultLanguage()) && $array['published'] != '1') {
         $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME'));
         return false;
     }
     if (isset($array['params']) && is_array($array['params'])) {
         $registry = new JRegistry();
         $registry->loadArray($array['params']);
         $array['params'] = (string) $registry;
     }
     return JTableNested::bind($array, $ignore);
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:35,代码来源:tablemenu.php


示例18: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     if (JPath::find(JPATH_SITE . DS . 'components' . DS . 'com_joomfish' . DS . 'helpers', 'defines.php')) {
         require_once JPATH_SITE . DS . 'components' . DS . 'com_joomfish' . DS . 'helpers' . DS . 'defines.php';
         require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomfish' . DS . 'classes' . DS . 'JoomfishManager.class.php';
     } else {
         JError::raiseNotice('no_jf_component', JText::_('Joom!Fish component not installed correctly. Plugin not executed'));
     }
     $jfm = JoomFishManager::getInstance();
     $activeLanguages = $jfm->getLanguagesIndexedById();
     if (!is_array($value)) {
         $default = "";
         $value = array();
         foreach ($activeLanguages as $key => $val) {
             $value[$key] = $val->id . "::" . $default . $val->shortcode;
         }
     }
     $indexedvalues = array();
     foreach ($value as $val) {
         list($key, $val) = split("::", $val, 2);
         $indexedvalues[$key] = $val;
     }
     $html = "<fieldset><table>";
     $html .= "<tr style='font-weight:bold;'><td>" . JText::_("Language") . "</td><td>" . JText::_("Prefix") . "</td></tr>";
     foreach ($activeLanguages as $key => $val) {
         $html .= "<tr>";
         $html .= '<td>' . $val->name . '</td><td>';
         $prefix = array_key_exists($val->id, $indexedvalues) ? $indexedvalues[$val->id] : "lang-" . $val->shortcode;
         $idprefix = $val->id . "::" . $prefix;
         $html .= "<input type='text' length='10' maxlength='50' id='sefprefix" . $val->id . "' onblur='document.getElementById(\"hiddensefprefix" . $val->id . "\").value=\"" . $val->id . "::\"+this.value;' value='" . $prefix . "' />";
         $html .= "<input type='hidden' id='hiddensefprefix" . $val->id . "' name='" . $control_name . '[' . $name . '][]' . "' value='" . $idprefix . "' />";
         $html .= "</td></tr>";
     }
     $html .= "</table></fieldset>";
     return $html;
 }
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:36,代码来源:sefprefix.php


示例19: _testUnpublisedTranslations

 /**
  * This method creates an overview of unpublished translations independed of the content element
  * @return array 	of unpublished translations or null
  */
 private function _testUnpublisedTranslations()
 {
     $db = JFactory::getDBO();
     $unpublishedTranslations = null;
     $sql = "select jfc.reference_table, jfc.reference_id, jfc.language_id, jfl.title as language" . "\n from #__jf_content as jfc, #__languages as jfl" . "\n where jfc.published=0  and jfc.language_id = jfl.lang_id" . "\n group by jfc.reference_table, jfc.reference_id, jfc.language_id" . "\n limit 0, 50";
     $db->setQuery($sql);
     if ($rows = $db->loadObjectList()) {
         foreach ($rows as $row) {
             $unpublished = array();
             $unpublished['reference_table'] = $row->reference_table;
             $unpublished['catid'] = $row->reference_table;
             $unpublished['reference_id'] = $row->reference_id;
             $unpublished['language_id'] = $row->language_id;
             $unpublished['language'] = $row->language;
             $unpublishedTranslations[] = $unpublished;
         }
     }
     $sqlnative = $db->getQuery(true);
     $sqlnative->select('jfc.reference_table,  jfc.reference_id, jfc.translation_id, jfc.language AS langcode, jfl.title AS language, jfl.lang_id AS language_id');
     $sqlnative->from('#__jf_translationmap AS jfc');
     $sqlnative->join('', '#__languages AS jfl ON jfc.language = jfl.lang_code');
     $celements = JoomFishManager::getInstance()->getContentElements();
     $where = array();
     foreach ($celements as $contentElement) {
         if ($contentElement->getTarget() == "native") {
             $sqlnative->leftJoin('#__' . $contentElement->getTableName() . ' AS jf' . $contentElement->getTableName() . ' ON jfc.reference_table=\'' . $contentElement->getTableName() . '\'' . ' AND jf' . $contentElement->getTableName() . '.' . $contentElement->getReferenceId() . '= jfc.translation_id' . ' AND jf' . $contentElement->getTableName() . '.' . $contentElement->getPublishedField() . '=0');
             $where[] = 'jf' . $contentElement->getTableName() . '.' . $contentElement->getPublishedField() . '=0';
             $sqlnative->select('jf' . $contentElement->getTableName() . '.' . $contentElement->getPublishedField() . ' AS published');
         }
     }
     $where = implode(' OR ', $where);
     $sqlnative->where($where);
     $db->setQuery($sqlnative);
     if ($rowsnative = $db->loadObjectList()) {
         foreach ($rowsnative as $row) {
             $unpublished = array();
             $unpublished['reference_table'] = $row->reference_table;
             $unpublished['catid'] = $row->reference_table;
             $unpublished['reference_id'] = $row->reference_id;
             $unpublished['language_id'] = $row->language_id;
             $unpublished['language'] = $row->language;
             $unpublishedTranslations[] = $unpublished;
         }
     }
     return $unpublishedTranslations;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:50,代码来源:cpanel.php


示例20: _determineLanguage

 function _determineLanguage($getLang = null, $redir = false, $useMainLang = false)
 {
     // set the language for JoomFish
     if (SEFTools::JoomFishInstalled()) {
         $sefConfig =& SEFConfig::getConfig();
         $registry =& JFactory::getConfig();
         // Check if the Jfrouter is enabled
         $jfrouterEnabled = JPluginHelper::isEnabled('system', 'jfrouter');
         // save the default language of the site if needed
         if (!$jfrouterEnabled) {
             $locale = $registry->getValue('config.language');
             $GLOBALS['mosConfig_defaultLang'] = $locale;
             $registry->setValue("config.defaultlang", $locale);
         }
         // get instance of JoomFishManager to obtain active language list and config values
         $jfm =& JoomFishManager::getInstance();
         // Get language from request
         if (!empty($getLang)) {
             $lang = $getLang;
         }
         // Try to get language code from JF cookie
         if ($sefConfig->jfLangCookie) {
             $jfCookie = JRequest::getVar('jfcookie', null, 'COOKIE');
             if (isset($jfCookie['lang'])) {
                 $cookieCode = $jfCookie['lang'];
             }
         }
         // Try to find language from browser settings
         if ($sefConfig->jfBrowserLang && isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
             $active_iso = array();
             $active_isocountry = array();
             $active_code = array();
             $activeLanguages = $jfm->getActiveLanguages();
             if (count($activeLanguages) > 0) {
                 foreach ($activeLanguages as $alang) {
                     $active_iso[] = $alang->iso;
                     if (preg_match('/[_-]/i', $alang->iso)) {
                         $iso = str_replace('_', '-', $alang->iso);
                         $isocountry = explode('-', $iso);
                         $active_isocountry[] = $isocountry[0];
                     }
                     $active_code[] = $alang->shortcode;
                 }
                 // figure out which language to use - browser languages are based on ISO codes
                 $browserLang = explode(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
                 foreach ($browserLang as $blang) {
                     if (in_array($blang, $active_iso)) {
                         $client_lang = $blang;
                         break;
                     }
                     $shortLang = substr($blang, 0, 2);
                     if (in_array($shortLang, $active_isocountry)) {
                         $client_lang = $shortLang;
                         break;
                     }
                     // compare with code
                     if (in_array($shortLang, $active_code)) {
                         $client_lang = $shortLang;
                         break;
                     }
                 }
                 if (!empty($client_lang)) {
                     if (strlen($client_lang) == 2) {
                         $browserCode = SEFTools::getLangLongCode($client_lang);
                     } else {
                         $browserCode = $client_lang;
                     }
                 }
             }
         }
         if (!$jfrouterEnabled && $redir && $sefConfig->langPlacement != _COM_SEF_LANG_DOMAIN && (isset($cookieCode) || isset($browserCode)) && $sefConfig->mainLanguage != '0') {
             if (isset($cookieCode)) {
                 $sc = SEFTools::getLangCode($cookieCode);
             } else {
                 $sc = SEFTools::getLangCode($browserCode);
             }
             // Check the referer to see if we should redirect
             $shouldRedir = false;
             if (isset($_SERVER['HTTP_REFERER'])) {
                 $refUri = new JURI($_SERVER['HTTP_REFERER']);
                 $uri = JURI::getInstance();
                 $refHost = $refUri->getHost();
                 $host = $uri->getHost();
                 if ($refHost != $host) {
                     $shouldRedir = true;
                 }
             } else {
                 $shouldRedir = true;
             }
             if ($shouldRedir) {
                 if (!empty($lang) && $sc != $lang || empty($lang) && $sc != $sefConfig->mainLanguage) {
                     // Redirect to correct site
                     $mainframe =& JFactory::getApplication();
                     $href = JRoute::_('index.php?lang=' . $sc, false);
                     $mainframe->redirect($href);
                     exit;
                 }
             }
         }
         // Check if language is selected
//.........这里部分代码省略.........
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:101,代码来源:joomsef.php



注:本文中的JoomFishManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JoomdleHelperContent类代码示例发布时间:2022-05-23
下一篇:
PHP JoinA类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap