示例#1
0
 function onAfterDeviceDetection(&$MobileJoomla_Settings, &$MobileJoomla_Device)
 {
     $host = $_SERVER['HTTP_HOST'];
     if (empty($host)) {
         return;
     }
     $this->getSchemePath($http, $base);
     // Check for current domain
     $markup = $MobileJoomla_Device['markup'];
     if (isset($MobileJoomla_Settings[$markup . '.domain']) && $host == $MobileJoomla_Settings[$markup . '.domain']) {
         $this->setConfig('live_site', $http . '://' . $host . $base);
         $this->_domain_markup = $markup;
         return;
     }
     // Mobile domains
     $markups_list = array('xhtml', 'iphone', 'tablet', 'chtml', 'wml');
     foreach ($markups_list as $markup) {
         if (isset($MobileJoomla_Settings[$markup . '.domain']) && $host == $MobileJoomla_Settings[$markup . '.domain'] && plgSystemMobileBot::checkMarkup($markup) !== false) {
             $this->_domain_markup = $MobileJoomla_Device['markup'];
             $MobileJoomla_Device['markup'] = $markup;
             $this->setConfig('live_site', $http . '://' . $host . $base);
             return;
         }
     }
     // Desktop domain
     $app = JFactory::getApplication();
     // is it non-first visit? Then don't redirect
     if ($app->getUserState('mobilejoomla.markup') !== null) {
         $markup = $MobileJoomla_Device['markup'];
         if (isset($MobileJoomla_Settings[$markup . '.domain']) && empty($MobileJoomla_Settings[$markup . '.domain'])) {
             return;
         }
         $MobileJoomla_Device['markup'] = '';
     }
 }
示例#2
0
function plgSystemMobileBot_onAfterRenderLast()
{
    return plgSystemMobileBot::onAfterRenderLast();
}
示例#3
0
        $source = JPATH_PLUGINS . '/' . $item->folder . '/' . $item->element;
        $file = 'plg_' . $item->folder . '_' . $item->element . '.sys';
        $lang->load($file, JPATH_ADMINISTRATOR, null, false, false) || $lang->load($file, $source, null, false, false) || $lang->load($file, JPATH_ADMINISTRATOR, $lang->getDefault(), false, false) || $lang->load($file, $source, $lang->getDefault(), false, false);
        $item->title = JText::_($item->title);
    }
}
// load mj settings
$query = 'SELECT * FROM #__mj_plugins';
$db->setQuery($query);
$mj_plugins = $db->loadObjectList();
if (empty($mj_plugins)) {
    $mj_plugins = array();
}
$modes = array('desktop' => 'Desktop', 'xhtml' => 'Smartphone', 'iphone' => 'iPhone', 'tablet' => 'Tablet', 'chtml' => 'i-mode', 'wml' => 'WAP');
foreach ($modes as $device => $title) {
    if (plgSystemMobileBot::CheckMarkup($device) === false) {
        unset($modes[$device]);
    }
}
$table = array();
if (count($plugins)) {
    foreach ($plugins as $plugin) {
        $table[$plugin->id] = array('desktop' => 1, 'xhtml' => 1, 'iphone' => 1, 'tablet' => 1, 'chtml' => 1, 'wml' => 1);
    }
}
foreach ($mj_plugins as $plugin) {
    $table[$plugin->id][$plugin->markup] = 0;
}
?>
<html>
<head>