コード例 #1
0
 /**
  * Add some other condition assets (css, javascript). Use to parse /etc/assets.xml
  *
  * @return  null
  */
 function addExtraAssets()
 {
     $base = JURI::base(true);
     $regurl = '#(http|https)://([a-zA-Z0-9.]|%[0-9A-Za-z]|/|:[0-9]?)*#iu';
     $afiles = T3Path::getAllPath('etc/assets.xml');
     foreach ($afiles as $afile) {
         if (is_file($afile)) {
             //load xml
             $axml = JFactory::getXML($afile);
             //process if exist
             if ($axml) {
                 foreach ($axml as $node => $nodevalue) {
                     //ignore others node
                     if ($node == 'stylesheets' || $node == 'scripts') {
                         foreach ($nodevalue->file as $file) {
                             $compatible = (string) $file['compatible'];
                             if ($compatible) {
                                 $parts = explode(' ', $compatible);
                                 $operator = '=';
                                 //exact equal to
                                 $operand = $parts[0];
                                 if (count($parts) == 2) {
                                     $operator = $parts[0];
                                     $operand = $parts[1];
                                 }
                                 //compare with Joomla version
                                 if (!version_compare(JVERSION, $operand, $operator)) {
                                     continue;
                                 }
                             }
                             $url = (string) $file;
                             if (substr($url, 0, 2) == '//') {
                                 //external link
                             } else {
                                 if ($url[0] == '/') {
                                     //absolute link from based folder
                                     $url = is_file(JPATH_ROOT . $url) ? $base . $url : false;
                                 } else {
                                     if (!preg_match($regurl, $url)) {
                                         //not match a full url -> sure internal link
                                         $url = T3Path::getUrl($url);
                                         // so get it
                                     }
                                 }
                             }
                             if ($url) {
                                 if ($node == 'stylesheets') {
                                     $type = $file['type'] ? (string) $file['type'] : 'text/css';
                                     $media = $file['media'] ? (string) $file['media'] : null;
                                     $this->addStylesheet($url, $type, $media);
                                 } else {
                                     $type = $file['type'] ? (string) $file['type'] : 'text/javascript';
                                     $defer = $file['defer'] ? (bool) $file['defer'] : false;
                                     $async = $file['async'] ? (bool) $file['async'] : false;
                                     $this->addScript($url, $type, $defer, $async);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     // template extended styles
     $aparams = $this->_tpl->params->toArray();
     $extras = array();
     $itemid = JFactory::getApplication()->input->get('Itemid');
     foreach ($aparams as $name => $value) {
         if (preg_match('/^theme_extras_(.+)$/', $name, $m)) {
             $extras[$m[1]] = $value;
         }
     }
     if (count($extras)) {
         foreach ($extras as $extra => $pages) {
             if (!is_array($pages) || !count($pages) || in_array(0, $pages)) {
                 continue;
                 // disabled
             }
             if (in_array(-1, $pages) || in_array($itemid, $pages)) {
                 // load this style
                 $this->addCss('extras/' . $extra);
             }
         }
     }
 }
コード例 #2
0
ファイル: style-4.php プロジェクト: jamielaff/als_projects
 * This file may not be redistributed in whole or significant part.
 * ------------------------------------------------------------------------
 */
defined('_JEXEC') or die;
// parse jdoc after render
$params->set('parse-jdoc', 1);
// use with T3
$t3doc = T3::getApp();
$doc = JFactory::getDocument();
// get params
$tplparams = JFactory::getApplication()->getTemplate(true)->params;
$sitename = $tplparams->get('sitename');
$slogan = $tplparams->get('slogan', '');
$logotype = $tplparams->get('logotype', 'text');
$logoimage = $logotype == 'image' ? $tplparams->get('logoimage', T3Path::getUrl('images/logo.png', '', true)) : '';
$logoimgsm = $logotype == 'image' && $tplparams->get('enable_logoimage_sm', 0) ? $tplparams->get('logoimage_sm', T3Path::getUrl('images/logo-sm.png', '', true)) : false;
$logolink = $tplparams->get('logolink');
if (!$sitename) {
    $sitename = JFactory::getConfig()->get('sitename');
}
$headright = $doc->countModules('head-search or languageswitcherload or right-menu') || $tplparams->get('addon_offcanvas_enable');
// get logo url
$logourl = JURI::base(true);
if ($logolink == 'page') {
    $logopageid = $tplparams->get('logolink_id');
    $_item = JFactory::getApplication()->getMenu()->getItem($logopageid);
    if ($_item) {
        $logourl = JRoute::_('index.php?Itemid=' . $logopageid);
    }
}
// Header Params
コード例 #3
0
ファイル: template.php プロジェクト: GitIPFire/Homeworks
 /**
  * Add some other condition assets (css, javascript)
  */
 function addExtraAssets()
 {
     $base = JURI::base(true);
     $regurl = '#(http|https)://([a-zA-Z0-9.]|%[0-9A-Za-z]|/|:[0-9]?)*#iu';
     foreach (array(T3_PATH, T3_TEMPLATE_PATH) as $bpath) {
         //full path
         $afile = $bpath . '/etc/assets.xml';
         if (is_file($afile)) {
             //load xml
             $axml = JFactory::getXML($afile);
             //parse stylesheets first if exist
             if ($axml) {
                 foreach ($axml as $node => $nodevalue) {
                     //ignore others node
                     if ($node == 'stylesheets' || $node == 'scripts') {
                         foreach ($nodevalue->file as $file) {
                             $compatible = $file['compatible'];
                             if ($compatible) {
                                 $parts = explode(' ', $compatible);
                                 $operator = '=';
                                 //exact equal to
                                 $operand = $parts[1];
                                 if (count($parts) == 2) {
                                     $operator = $parts[0];
                                     $operand = $parts[1];
                                 }
                                 //compare with Joomla version
                                 if (!version_compare(JVERSION, $operand, $operator)) {
                                     continue;
                                 }
                             }
                             $url = (string) $file;
                             if (substr($url, 0, 2) == '//') {
                                 //external link
                             } else {
                                 if ($url[0] == '/') {
                                     //absolute link from based folder
                                     $url = is_file(JPATH_ROOT . $url) ? $base . $url : false;
                                 } else {
                                     if (!preg_match($regurl, $url)) {
                                         //not match a full url -> sure internal link
                                         $url = T3Path::getUrl($url);
                                         // so get it
                                     }
                                 }
                             }
                             if ($url) {
                                 if ($node == 'stylesheets') {
                                     $this->addStylesheet($url);
                                 } else {
                                     $this->addScript($url);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #4
0
ファイル: head.php プロジェクト: ashanrupasinghe/slbcv2
?>
;
</script>

<jdoc:include type="head" />

<?php 
if (T3Common::mobile_device_detect() == 'iphone') {
    ?>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1; user-scalable=1;" />
<meta name="apple-touch-fullscreen" content="YES" />
<?php 
}
?>

<?php 
if (T3Common::mobile_device_detect()) {
    ?>
<meta name="HandheldFriendly" content="true" />
<?php 
}
?>

<link href="<?php 
echo T3Path::getUrl('images/favicon.ico');
?>
" rel="shortcut icon" type="image/x-icon" />

<?php 
JHTML::stylesheet('templates/system/css/system.css');
JHTML::stylesheet('templates/system/css/general.css');
コード例 #5
0
Setting for this message. Clear cookie if you change this setting.
'none': Not show warning
'once': Show one time only
'close': Show until user check box "Not show again" and close the message
'always': Always show this message
*/
if (!SHOW_IE6_WARNING || SHOW_IE6_WARNING == 'none') {
    return;
}
$this->addParamCookie('ie6w_notshowagain');
if (SHOW_IE6_WARNING != 'always' && $this->getParam('ie6w_notshowagain', 0)) {
    return;
}
?>
<link rel="stylesheet" href="<?php 
echo T3Path::getUrl("blocks/ie6/ie6warning.css");
?>
" type="text/css" />
<div style="" id="ie6-warning" class="wrap">
	<div class="main"><div class="inner clearfix">	
		
		<p class="note"><img src="plugins/system/jat3/base-themes/default/blocks/ie6/note.png" title="" alt="" align="left" /></p>
		<ul>
			<li><a class="firefox-download" href="http://www.mozilla.com/firefox/" target="_blank" title="Download Firefox">&nbsp;</a></li>
			<li><a class="chrome-download" href="http://www.google.com/chrome" target="_blank" title="Download Chrome">&nbsp;</a></li>
			<li><a class="safari-download" href="http://www.apple.com/safari/download/" target="_blank" title="Download Safari">&nbsp;</a></li>
			<li><a class="opera-download" href="http://www.opera.com/download/" target="_blank" title="Download Opera">&nbsp;</a></li>
			<li><a class="ie-download" href="http://www.microsoft.com/windows/Internet-explorer/default.aspx" target="_blank" title="Download Internet Explorer 8 NOW!">&nbsp;</a></li>
		</ul>
		
		<div class="close">
コード例 #6
0
ファイル: footer.php プロジェクト: ForAEdesWeb/AEW25
<?php

/**
 * @package   T3 Blank
 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license   GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
// get params
$sitename = $this->params->get('sitename');
$slogan = $this->params->get('slogan', '');
$logotype = $this->params->get('logofootertype', 'text');
$logoimage = $logotype == 'image' ? $this->params->get('logofooterimage', T3Path::getUrl('images/logo.png', '', true)) : '';
if (!$sitename) {
    $sitename = JFactory::getConfig()->get('sitename');
}
?>

<!-- FOOTER -->
<footer id="t3-footer" class="wrap t3-footer">
  <!-- LOGO -->
  <div class="logo">
    <div class="logo-<?php 
echo $logotype, '' ? ' logo-control' : '';
?>
">
      <a href="<?php 
echo JURI::base(true);
?>
" title="<?php 
echo strip_tags($sitename);
コード例 #7
0
ファイル: debug.php プロジェクト: ashanrupasinghe/slbcv2
    <?php 
    if (is_dir(T3Path::path('layoutinfo', true))) {
        ?>
        <link type="text/css" rel="stylesheet" href="<?php 
        echo T3Path::url('layoutinfo/style.css', true);
        ?>
" />
        <script type="text/javascript" src="<?php 
        echo T3Path::url('layoutinfo/script.js', true);
        ?>
"></script>
    <?php 
    } else {
        ?>
        <?php 
        if (T3Path::getPath('layoutinfo')) {
            ?>
        <link type="text/css" rel="stylesheet" href="<?php 
            echo T3Path::getUrl('layoutinfo/style.css');
            ?>
" />
        <script type="text/javascript" src="<?php 
            echo T3Path::getUrl('layoutinfo/script.js');
            ?>
"></script>
        <?php 
        }
        ?>
    <?php 
    }
}