本文整理汇总了PHP中CopixI18N::getLang方法的典型用法代码示例。如果您正苦于以下问题:PHP CopixI18N::getLang方法的具体用法?PHP CopixI18N::getLang怎么用?PHP CopixI18N::getLang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CopixI18N
的用法示例。
在下文中一共展示了CopixI18N::getLang方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processDefault
public function processDefault()
{
$tpl = new CopixTpl();
$tplModule = new CopixTpl();
//if user is not connected :
if (1) {
// S'il y a un blog prevu a l'accueil
$dispBlog = false;
$getKernelLimitsIdBlog = Kernel::getKernelLimits('id_blog');
if ($getKernelLimitsIdBlog) {
_classInclude('blog|kernelblog');
if ($blog = _ioDao('blog|blog')->getBlogById($getKernelLimitsIdBlog)) {
// On v�rifie qu'il y a au moins un article
$stats = KernelBlog::getStats($blog->id_blog);
if ($stats['nbArticles']['value'] > 0) {
$dispBlog = true;
}
}
}
if ($dispBlog) {
//return CopixActionGroup::process ('blog|frontblog::getListArticle', array ('blog'=>$blog->url_blog));
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('blog||', array('blog' => $blog->url_blog)));
}
if (!CopixConfig::exists('|can_public_rssfeed') || CopixConfig::get('|can_public_rssfeed')) {
CopixHtmlHeader::addOthers('<link rel="alternate" href="' . CopixUrl::get('public||rss', array()) . '" type="application/rss+xml" title="' . htmlentities(CopixI18N::get('public|public.rss.flux.title')) . '" />');
}
CopixHTMLHeader::addCSSLink(_resource("styles/module_fichesecoles.css"));
$tplModule->assign('user', _currentUser());
$result = $tplModule->fetch('welcome|welcome_' . CopixI18N::getLang() . '.tpl');
$tpl->assign('TITLE_PAGE', '' . CopixI18N::get('public|public.welcome.title'));
$tpl->assign('MAIN', $result);
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
}
示例2: processAccessibilite
/**
* Page Accessibilité
*
* @author Philippe Roser <proser@cap-tic.fr>
* @since 2012/09/21
*/
public function processAccessibilite()
{
$ppo = new CopixPPO();
$ppo->TITLE_PAGE = CopixI18N::get('public|public.nav.accessibility');
$nametpl = 'accessibilite_' . CopixI18N::getLang() . '.tpl';
return _arPPO($ppo, $nametpl);
}
示例3: smarty_function_htmlarea
function smarty_function_htmlarea($params, &$smarty)
{
static $_init = false;
extract($params);
//check the initialisation
if (!$_init) {
CopixHtmlHeader::addJsCode('_editor_url = "' . CopixUrl::get() . 'js/htmlarea/";');
//path of the library
if (empty($path)) {
$path = CopixUrl::get() . 'js/htmlarea/';
//default path under CopiX
}
CopixHTMLHeader::addJSLink($path . 'htmlarea.js');
CopixHTMLHeader::addJSLink($path . 'dialog.js');
if (empty($lang)) {
$lang = CopixI18N::getLang();
}
CopixHTMLHeader::addJSLink($path . 'lang/' . $lang . '.js');
CopixHTMLHeader::addCSSLink($path . 'htmlarea.css');
CopixHTMLHeader::addJSLink($path . 'popupwin.js');
CopixHTMLHeader::addJSCode('
HTMLArea.loadPlugin("TableOperations");
HTMLArea.loadPlugin("InsertAnchor");
HTMLArea.loadPlugin("TableToggleBorder");
HTMLArea.loadPlugin("AstonTools");
HTMLArea.loadPlugin("ContextMenu");
');
$_init = true;
}
if (empty($content)) {
$content = '';
}
//name of the textarea.
if (empty($name)) {
$smarty->trigger_error('htmlarea: missing name parameter');
} else {
// CopixHTMLHeader::addOthers ($script);
if (!$width) {
$width = 500;
}
if (!$height) {
$height = 500;
}
$out = '<textarea id="' . $name . '" name="' . $name . '" style="width: ' . $width . 'px; height:' . $height . 'px;" >' . $content . '</textarea>';
$out .= '<script type="text/javascript" defer="1">
var editor' . $name . ' = null;
editor' . $name . ' = new HTMLArea("' . $name . '");
editor' . $name . '.registerPlugin("TableOperations");
editor' . $name . '.registerPlugin("TableToggleBorder");
editor' . $name . '.registerPlugin("InsertAnchor");
editor' . $name . '.registerPlugin("AstonTools");
editor' . $name . '.registerPlugin("ContextMenu");
editor' . $name . '.config.pageStyle = "@import url(\\"' . CopixUrl::get() . 'styles/styles_copix.css\\");";
editor' . $name . '.generate ();
</script>';
}
return $out;
}
示例4: smarty_function_calendar
function smarty_function_calendar($params, &$smarty)
{
static $_init = false;
extract($params);
//check the initialisation
if (!$_init) {
//path of the library
CopixHTMLHeader::addCSSLink(CopixUrl::get() . "js/dynCal/dynCalendar.css", array('media' => 'screen'));
CopixHTMLHeader::addJSLink(CopixUrl::get() . "js/dynCal/browserSniffer.js");
CopixHTMLHeader::addJSLink(CopixUrl::get() . "js/dynCal/dynCalendar.js");
if (empty($lang)) {
$lang = CopixI18N::getLang();
}
CopixHTMLHeader::addJSLink(CopixUrl::get() . "js/dynCal/lang/" . $lang . ".js");
$_init = true;
}
//Calculating the jsCode (kind of silly trick to use a separator as a part of jsCode, but still quick)
$jsCode = str_replace(array('d', 'm', 'Y'), array('day', 'month', 'year'), CopixI18N::getDateFormat(" + '/' + "));
CopixHTMLHeader::addJSCode("\n\r" . '
function calendarCallback' . $name . '(day, month, year) {
var tmp;
if (String(month).length == 1) {
month = \'0\' + month;
}
if (String(day).length == 1) {
day = \'0\' + day;
}
tmp = document.getElementById (\'' . $name . '\');
tmp.value = ' . $jsCode . ';
}
' . "\n\r");
//name of the textarea.
if (empty($name)) {
$smarty->trigger_error('[smarty_calendar] missing name parameter');
} else {
$out = '<input type="text" class="calendar" id="' . $name . '" name="' . $name . '" value="' . $value . '">' . "\n\r";
$out .= '<script language="javascript" type="text/javascript">' . "\n\r";
$out .= '<!--' . "\n\r";
$out .= 'calendar_' . $name . ' = new dynCalendar(\'calendar_' . $name . '\', \'calendarCallback' . $name . '\', \'' . CopixUrl::get() . 'js/dynCal/images/\');' . "\n\r";
$out .= '//-->' . "\n\r";
$out .= '</script>' . "\n\r";
}
return $out;
}
示例5: processViewHelp
/**
* Affiche l'aide
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2006/04/12
*/
public function processViewHelp()
{
$rubrique = $this->getRequest('rubrique', null);
$page = $this->getRequest('page', null);
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('aide|aide.description'));
//$tpl->assign ('MENU', $menu);
if ($rubrique) {
$hasHelpRub = false;
$arModulesPath = CopixConfig::instance()->arModulesPath;
foreach ($arModulesPath as $modulePath) {
$file = $modulePath . $rubrique . '/' . COPIX_CLASSES_DIR . 'help' . $rubrique . '.class.php';
if (file_exists($file)) {
$hasHelpRub = true;
$modhelp =& CopixClassesFactory::Create($rubrique . '|help' . $rubrique);
if (method_exists($modhelp, 'getPages')) {
$pages = $modhelp->getPages();
}
if ($page && is_array($pages) && isset($pages[$page])) {
// Page précise
$tpl->assign('TITLE_PAGE', Kernel::Code2Name('mod_' . $rubrique) . ' - ' . $pages[$page]['title']);
$tpl->assign('MENU', '<a href="' . CopixUrl::get('aide||', array('rubrique' => $rubrique)) . '">' . CopixI18N::get('aide|aide.link.top') . '</a> :: <a href="' . CopixUrl::get('aide||') . '">' . CopixI18N::get('aide|aide.link.index') . '</a>');
// On vérifie que le fichier existe bien
$lg = CopixI18N::getLang();
$file = $modulePath . $rubrique . '/' . COPIX_TEMPLATES_DIR . 'help_' . $page . '_' . $lg . '.html';
if (file_exists($file)) {
//$tpl->assignStatic ('text', $rubrique.'|help_'.$page.'_'.$lg.'.html');
$tpl2 = new CopixTpl();
$text = $tpl2->fetch($rubrique . '|help_' . $page . '_' . $lg . '.html');
$tpl->assign('text', $text);
$tpl->assign('rubrique', $rubrique);
$tpl->assign('pages', $pages);
$see = array();
if (isset($pages[$page]['links']) && is_array($pages[$page]['links'])) {
$links = $pages[$page]['links'];
//print_r($links);
foreach ($links as $link) {
$l = explode('|', $link);
//print_r($l);
if (count($l) == 1) {
// Même module
$see[] = array('rubrique' => $rubrique, 'page' => $l[0], 'title' => $pages[$l[0]]['title']);
} else {
// Autre module
$arModulesPath2 = CopixConfig::instance()->arModulesPath;
foreach ($arModulesPath2 as $modulePath2) {
$file = $modulePath2 . $l[0] . '/' . COPIX_CLASSES_DIR . 'help' . $l[0] . '.class.php';
if (file_exists($file)) {
$modhelp2 =& CopixClassesFactory::Create($l[0] . '|help' . $l[0]);
if (method_exists($modhelp2, 'getPages')) {
$pages2 = $modhelp2->getPages();
//print_r($pages2);
$see[] = array('rubrique' => $l[0], 'page' => $l[1], 'title' => $pages2[$l[1]]['title']);
}
}
}
}
}
}
$tpl->assign('links', $see);
}
$MAIN = $tpl->fetch('viewhelprubpage.tpl');
} else {
// Sommaire de l'aide du module
$tpl->assign('TITLE_PAGE', Kernel::Code2Name('mod_' . $rubrique));
$tpl->assign('MENU', '<a href="' . CopixUrl::get('aide||') . '">' . CopixI18N::get('aide|aide.link.index') . '</a>');
$tpl->assign('rubrique', $rubrique);
$tpl->assign('pages', $pages);
$MAIN = $tpl->fetch('viewhelprub.tpl');
}
}
}
if (!$hasHelpRub) {
$MAIN = $tpl->fetch('viewhelp.tpl');
}
} else {
$rubs = array('minimail', 'album');
// Compléter avec les modules dont l'aide est écrite
$rubriques = array();
foreach ($rubs as $rub) {
$rubriques[] = array('name' => $rub, 'title' => Kernel::Code2Name('mod_' . $rub));
}
$tpl->assign('rubriques', $rubriques);
$MAIN = $tpl->fetch('viewhelp.tpl');
}
$tpl->assign('MAIN', $MAIN);
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例6: getResourcePath
/**
* Récupère un chemin de ressource (situé dans www)
*
* Ira chercher dans l'ordre de priorité dans
* ./nom_theme/lang_COUNTRY/$path
* ./nom_theme/lang/$path
* ./nom_theme/$path
* ./default/lang_COUNTRY/$path
* ./default/lang/$path
* ./default/$path
* ./$path
*
* <code>
* //on souhaites récupérer la feuille de style
* $path = CopixURL::getRessourcePath ('styles/copix.css');
* //$path == /var/www/themes/nom_du_theme/styles/copix.css si le fichier existe
* </code>
*
* @param string $resourcePath le chemin du fichier que l'on souhaites récupérer
* www/$ressourcePath (doit représenter un fichier)
* @return string le $ressourcePath complet en fonction des thèmes
*/
public static function getResourcePath($pResourcePath)
{
static $calculated = array();
$theme = CopixTpl::getTheme();
$i18n = CopixConfig::instance()->i18n_path_enabled;
$lang = CopixI18N::getLang();
$country = CopixI18N::getCountry();
$key = $theme . $i18n . $lang . $country . $pResourcePath;
if (isset($calculated[$key])) {
return $calculated[$key];
}
list($resourcePath, $moduleName, $modulePath) = self::_parseResourcePath($pResourcePath);
// Utilise CopixResource pour trouver la ressource
return $calculated[$key] = CopixResource::findResourcePath($resourcePath, $moduleName, $modulePath, $theme, $i18n, $lang, $country);
}
示例7: smarty_function_htmleditor
function smarty_function_htmleditor($params, &$smarty)
{
static $_init = false;
extract($params);
//check the initialisation
if (!$_init) {
switch (strtolower(CopixConfig::get('htmleditor|type'))) {
case 'htmlarea':
CopixHtmlHeader::addJsCode('_editor_url = "' . CopixUrl::get() . 'js/htmlarea/";');
//path of the library
if (empty($htmlPath)) {
$htmlPath = CopixUrl::get() . 'js/htmlarea/';
//default path under CopiX
}
CopixHTMLHeader::addJSLink($htmlPath . 'htmlarea.js');
CopixHTMLHeader::addJSLink($htmlPath . 'dialog.js');
if (empty($lang)) {
$lang = CopixI18N::getLang();
}
CopixHTMLHeader::addJSLink($htmlPath . 'lang/' . $lang . '.js');
CopixHTMLHeader::addCSSLink($htmlPath . 'htmlarea.css');
CopixHTMLHeader::addJSLink($htmlPath . 'popupwin.js');
$jsCode = 'HTMLArea.loadPlugin("TableOperations");
HTMLArea.loadPlugin("InsertAnchor");
HTMLArea.loadPlugin("TableToggleBorder");
HTMLArea.loadPlugin("ContextMenu");';
if (CopixModule::isValid('pictures') && CopixModule::isValid('cms') && CopixModule::isValid('document')) {
$jsCode = 'HTMLArea.loadPlugin("AstonTools");';
}
CopixHTMLHeader::addJSCode($jsCode);
break;
case 'fckeditor':
default:
$path = COPIX_MODULE_PATH . 'htmleditor/' . COPIX_CLASSES_DIR;
$htmlPath = CopixUrl::get() . 'js/FCKeditor/';
require_once $path . 'fckeditor.php';
break;
}
// CopixHTMLHeader::addJSLink ($path.'fckconfig.js');
// CopixHTMLHeader::addJSLink ($path.'fckeditor.js');
$_init = true;
}
if (empty($content)) {
$content = ' ';
}
//name of the textarea.
if (empty($name)) {
$smarty->trigger_error('htmleditor: missing name parameter');
} else {
if (!$width) {
$width = CopixConfig::get('htmleditor|width');
//$width = '100%';
}
if (!$height) {
$height = CopixConfig::get('htmleditor|height');
//$height = '450px';
}
switch (strtolower(CopixConfig::get('htmleditor|type'))) {
case 'htmlarea':
$out = '<textarea id="' . $name . '" name="' . $name . '" style="width: ' . $width . 'px; height:' . $height . 'px;" >' . $content . '</textarea>';
$out .= '<script type="text/javascript" defer="1">
var editor' . $name . ' = null;
editor' . $name . ' = new HTMLArea("' . $name . '");
editor' . $name . '.registerPlugin("TableOperations");
editor' . $name . '.registerPlugin("TableToggleBorder");
editor' . $name . '.registerPlugin("InsertAnchor");
editor' . $name . '.registerPlugin("ContextMenu");';
if (CopixModule::isValid('pictures') && CopixModule::isValid('cms') && CopixModule::isValid('document')) {
$out .= 'editor' . $name . '.registerPlugin("AstonTools");';
}
$out .= 'editor' . $name . '.config.pageStyle = "@import url(\\"' . CopixUrl::get() . 'styles/styles_copix.css\\");";
editor' . $name . '.generate ();
</script>';
break;
case 'fckeditor':
default:
/*
* ATTENTION les éléments de config viewPhototèque etc font doublon avec la sélection de la toolbarset, mais sont nécessaire à Copix
* Par contre si on ne les load pas, on a une erreur de FCKeditor, il faut donc supprimer ce gestionnaire d'erreur sinon on se prend un alert javascript
* le gestionnaire en question se trouve dans "FCKToolbarItems.GetItem" (chercher cette chaîne pour le trouver) et désactiver "alert( FCKLang.UnknownToolbarItem.replace( /%1/g, itemName ) ) ;"
*/
$oFCKeditor = new FCKeditor($name);
$oFCKeditor->BasePath = $htmlPath;
$oFCKeditor->Value = $content;
$oFCKeditor->ToolbarSet = 'Copix';
$oFCKeditor->Width = $width;
$oFCKeditor->Height = $height;
$oFCKeditor->Config['viewPhototheque'] = CopixModule::isValid('pictures') ? 'true' : 'false';
$oFCKeditor->Config['viewCmsLink'] = CopixModule::isValid('cms') ? 'true' : 'false';
$oFCKeditor->Config['viewLinkPopup'] = CopixModule::isValid('cms') ? 'true' : 'false';
$oFCKeditor->Config['viewDocument'] = CopixModule::isValid('document') ? 'true' : 'false';
// Configuration de la feuille de style à utiliser.
$oFCKeditor->Config['EditorAreaCSS'] = CopixUrl::get() . 'styles/styles_copix.css';
$out = $oFCKeditor->CreateHtml();
break;
}
}
return $out;
}
示例8: __construct
/**
* Initialisation de la langue avec les éléments par défaut
*/
public function __construct($config)
{
parent::__construct($config);
$this->_lang = CopixI18N::getLang();
$this->_country = CopixI18N::getCountry();
}
示例9:
?>
'; getRessourcePathImg = urlBase+'<?php
echo CopixURL::getResourcePath('img/');
?>
/';</script>
<script type="text/javascript" src="<?php
echo CopixUrl::getResource("js/jquery/jquery.tools.min.js");
?>
"></script>
<script type="text/javascript" src="<?php
echo CopixUrl::getResource("js/iconito/iconito.js");
?>
"></script>
<script type="text/javascript" src="<?php
echo CopixUrl::getResource("js/iconito/lang_" . CopixI18N::getLang() . ".js");
?>
"></script>
<script type="text/javascript" src="<?php
echo CopixUrl::getResource("flvplayer/ufo.js");
?>
"></script>
<script type="text/javascript" src="<?php
echo CopixUrl::getResource("js/jquery-1.8.2.min.js");
?>
"></script>
<script type="text/javascript" src="<?php
echo CopixUrl::getResource("js/jquery-ui-1.9.0.custom.min.js");
?>
"></script>
示例10: process
/**
* Construction du code HTML
* On utilise également les modifications d'en tête HTML
*/
public function process($pParams, $pContent = null)
{
extract($pParams);
if (empty($name)) {
throw new CopixTemplateTagException('[calendar] missing name parameter');
}
if (empty($image)) {
$image = '"' . _resource("img/tools/calendar.png") . '"';
} else {
$image = '"' . $image . '"';
}
if (empty($extra)) {
$extra = '';
}
if (empty($size)) {
$size = 8;
}
if (!isset($mask)) {
$mask = true;
}
_tag('mootools', array('plugin' => array('datepicker')));
if ($mask) {
_tag('mootools', array('plugin' => array('imask')));
CopixHTMLHeader::addJsCode("\n window.addEvent('domready', function () {\n new iMask({\n onFocus: function(obj) {\n },\n\n onBlur: function(obj) {\n },\n\n onValid: function(event, obj) {\n },\n\n onInvalid: function(event, obj) {\n if(!event.shift) {\n }\n }\n });\n });\n ", 'calendarmask');
}
if (empty($lang)) {
$lang = CopixI18N::getLang();
}
if (empty($format)) {
$format = str_replace(array('d', 'm', 'Y'), array('dd', 'mm', 'yyyy'), CopixI18N::getDateFormat('/'));
} else {
$format = strtolower($format);
}
$maskFormat = str_replace(array('d', 'm', 'y'), array('9', '9', '9'), $format);
if (!empty($yyyymmdd)) {
$value = date(str_replace(array('dd', 'mm', 'yyyy'), array('d', 'm', 'Y'), $format), CopixDateTime::yyyymmddToTimestamp($yyyymmdd));
}
if (!empty($timestamp)) {
$value = date(str_replace(array('dd', 'mm', 'yyyy'), array('d', 'm', 'Y'), $format), $timestamp);
}
if (empty($sizeday)) {
$sizeday = 3;
}
if (!isset($beforeyear)) {
$beforeyear = 10;
}
if (!isset($afteryear)) {
$afteryear = 10;
}
if (!isset($duration)) {
$duration = 500;
}
if (!isset($closebuttonsrc)) {
$closebuttonsrc = null;
} else {
$closebuttonsrc = _resource($closebuttonsrc);
}
if (!isset($draggable)) {
$draggable = true;
}
$draggable = $draggable ? 'true' : 'false';
if (!isset($title)) {
$title = null;
}
if (empty($value)) {
if ($mask) {
$value = str_replace('9', '_', $maskFormat);
} else {
$value = null;
}
}
$strMask = '';
if ($mask) {
$strMask = 'style="text-align:center" class="iMask" alt="{ type:\'fixed\', mask:\'' . $maskFormat . '\', stripMask: false }"';
}
$out = '<input type="text" id="' . $name . '" name="' . $name . '" value="' . _copix_utf8_htmlentities($value) . '" ' . $extra . ' size="' . $size . '" ';
//name of the input.
if (!empty($tabindex)) {
$out .= ' tabindex="' . $tabindex . '" ';
}
$out .= $strMask . ' />' . "\n\r";
$out .= '<script type="text/javascript">' . "\n\r";
$out .= "\$('" . $name . "').makeDatePicker({draggable:{$draggable}, title: '" . str_replace("'", "\\'", $title) . "', closebuttonsrc: '" . $closebuttonsrc . "', value: '" . $value . "', format: '" . $format . "', language: '" . $lang . "', sizeday:" . $sizeday . ", beforeyear:" . $beforeyear . ", afteryear:" . $afteryear . ", duration:" . $duration . ", imageCalendar:" . $image;
//class du calendrier.
if (!empty($classe)) {
$out .= ', classe:"' . $classe . '"';
}
$out .= "});" . "\n\r";
return $out .= '</script>';
}
示例11: getDateFormat
/**
* Gets the date format according to the current language / country
*/
function getDateFormat($separator)
{
$lang = CopixI18N::getLang();
$country = CopixI18N::getCountry();
switch ($lang) {
case 'fr':
$format = "d" . $separator . "m" . $separator . "Y";
break;
case 'en':
$format = "m" . $separator . "d" . $separator . "Y";
break;
trigger_error(CopixI18N::get('copix:copix.error.i18n.unknowDateFormat', array($lang, $country)), E_USER_ERROR);
}
return $format;
}
示例12: getFilePath
/**
* Récupère le chemin du fichier template qui sera utilisé pour l'identifiant donné
* @param string $pTplName L'identifiant du template à utiliser
* @return string le chemin du fichier qui sera utilisé pour l'identifiant donnée
*/
public function getFilePath($pTplName)
{
if (isset(self::$_tplFilePathCache[$pTplName])) {
return self::$_tplFilePathCache[$pTplName];
}
//Using a selector to find out the fileName
$fileSelector = CopixSelectorFactory::create($pTplName);
$fileName = $fileSelector->fileName;
$config = CopixConfig::instance();
$toReturn = false;
//On a donné un chemin complet direct, on retourne directement
if ($fileSelector->type !== 'module') {
if (file_exists($templateFilePath = $fileSelector->getPath() . $fileName)) {
$toReturn = $templateFilePath;
}
} else {
$toReturn = CopixResource::findThemeTemplate($fileSelector->fileName, $fileSelector->module, $fileSelector->getPath(), self::getTheme(), $config->i18n_path_enabled, CopixI18N::getLang(), CopixI18N::getCountry());
}
// Met en cache le résultat
self::$_tplFilePathCache[$pTplName] = $toReturn;
self::$_tplFilePathCache[$fileSelector->getSelector()] = $toReturn;
return $toReturn;
}
示例13: YYYYMMtoYearMonthName
public function YYYYMMtoYearMonthName($date)
{
if (CopixI18N::getLang() == "fr") {
$toReturn = CopixI18N::get('blog|blog.month.' . substr($date, 4, 2)) . ' ' . substr($date, 0, 4);
} elseif (CopixI18N::getLang() == "eu") {
$toReturn = CopixI18N::get('blog|blog.month.' . substr($date, 4, 2)) . ' ' . substr($date, 0, 4);
} else {
$toReturn = CopixI18N::get('blog|blog.month.' . substr($date, 4, 2)) . ' ' . substr($date, 0, 4);
}
return $toReturn;
}
示例14: addJSFramework
/**
* Demande le chargement de Mootools.
*
* @param array $pPlugins Liste de plugins à charger.
*/
public static function addJSFramework($pPlugins = null)
{
// Charge le noyau
if (!isset(self::$_JSFrameworkAdded['*core*'])) {
self::$_JSFrameworkAdded['*core*'] = true;
// Initialise Mootools et l'identifiant de session
if (!CopixAJAX::isAJAXRequest()) {
// Ajoute MooTools et FirebugLite
if (CopixConfig::instance()->getMode() == CopixConfig::DEVEL) {
// MooTools non compressé et FirebugLite normal
self::addJSLink(_resource('js/firebuglite/firebug.js'), array('id' => 'firebug_js'));
self::addJSLink(_resource('js/mootools/mootools-devel.js'), array('id' => 'mootools_core_js'));
} else {
// MooTools compressé et FirebugLite qui ne fait rien.
self::addJSLink(_resource('js/firebuglite/firebugx.js'), array('id' => 'firebug_js'));
self::addJSLink(_resource('js/mootools/mootools.js'), array('id' => 'mootools_core_js'));
}
// Ajoute le framework JS spécifique de Copix
self::addJSLink(_resource('js/copix.js'), array('id' => 'copix_js', 'charset' => 'UTF-8'));
// Ajoute le code d'initialisation
$urlBase = CopixUrl::get();
self::addJSCode(sprintf('Copix = new CopixClass(%s);', CopixJSON::encode(array('ajaxSessionId' => CopixAJAX::getSessionId(), 'module' => CopixContext::get(), 'urlBase' => $urlBase, 'resourceUrlBase' => CopixResource::getResourceBaseUrl($urlBase, CopixTpl::getTheme(), CopixI18N::getLang(), CopixI18N::getCountry())))), 'copixajax_init', CopixHTMLHeader::DOMREADY_ALWAYS);
}
}
// Charge les plugins
if (is_array($pPlugins)) {
foreach ($pPlugins as $pluginName) {
if (!isset(self::$_JSFrameworkAdded[$pluginName])) {
self::$_JSFrameworkAdded[$pluginName] = true;
$pluginId = 'mootools_plugin_' . $pluginName;
$scriptId = $pluginId . '_js';
$stylesheetId = $pluginId . '_css';
if (file_exists(CopixUrl::getResourcePath($path = 'js/mootools/plugins/' . $pluginName . '.js'))) {
self::addJSLink(_resource($path), array("id" => $scriptId));
} elseif (file_exists(CopixUrl::getResourcePath($path = 'js/mootools/plugins/' . $pluginName . '.js.php'))) {
self::addJSLink(_resource($path), array("id" => $scriptId));
} else {
throw new CopixException('[Mootools] Plugin ' . $pluginName . ' not found in ' . $pluginPath);
}
if (file_exists(CopixUrl::getResourcePath($path = 'js/mootools/css/' . $pluginName . '.css'))) {
self::addCssLink(_resource($path), array("id" => $stylesheetId));
}
}
}
}
}
示例15:
<script type="text/javascript">var urlBase = '<?php
echo CopixUrl::getRequestedScriptPath();
?>
'; getRessourcePathImg = urlBase+'<?php
echo CopixURL::getResourcePath('img/');
?>
/';</script>
<script type="text/javascript" src="<?php
echo CopixUrl::get();
?>
js/iconito/iconito.js"></script>
<script type="text/javascript" src="<?php
echo CopixUrl::get();
?>
js/iconito/lang_<?php
echo CopixI18N::getLang();
?>
.js"></script>
<script type="text/javascript" src="<?php
echo CopixUrl::get();
?>
flvplayer/ufo.js"></script>
<script type="text/javascript" src="<?php
echo CopixUrl::get();
?>
js/prototype-1.6.0.3.js"></script>
<?php
}
?>
<link rel="shortcut icon" type="image/x-icon" href="<?php
echo CopixUrl::get();