本文整理汇总了PHP中e107::plugLan方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::plugLan方法的具体用法?PHP e107::plugLan怎么用?PHP e107::plugLan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::plugLan方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin
/**
* Admin callback
* Language file not loaded as all language data is inside the lan_eurl.php (loaded by default on administration URL page)
*/
public function admin()
{
// static may be used for performance
e107::plugLan('tagwords');
static $admin = array('labels' => array('name' => LAN_TAG_URL_NAME, 'label' => LAN_TAG_URL_DEFAULT_LABEL, 'description' => LAN_TAG_URL_DEFAULT_DESCR), 'form' => array(), 'callbacks' => array());
return $admin;
}
示例2: init
public function init()
{
e107::plugLan('gallery', 'front');
e107::js('gallery', 'jslib/prettyPhoto/js/jquery.prettyPhoto.js', 'jquery');
e107::css('gallery', 'jslib/prettyPhoto/css/prettyPhoto.css', 'jquery');
e107::css('gallery', 'gallery_style.css');
$prettyPhoto = <<<JS
\$(document).ready(function(){
\$("a[data-gal^='prettyPhoto']").prettyPhoto(
\t {
\t \thook: 'data-gal',
\t \ttheme: 'pp_default',
\t \toverlay_gallery: false,
\t \tdeeplinking: false
\t }
);
});
JS;
e107::js('footer-inline', $prettyPhoto, 'jquery');
$this->catList = e107::getMedia()->getCategories('gallery');
}
示例3: admin
/**
* Admin callback
* Language file not loaded as all language data is inside the lan_eurl.php (loaded by default on administration URL page)
*/
public function admin()
{
// static may be used for performance
e107::plugLan('forum', 'lan_forum_url');
static $admin = array('labels' => array('name' => LAN_PLUGIN_FORUM_NAME, 'label' => FORUM_LAN_URL_DEFAULT_LABEL, 'description' => FORUM_LAN_URL_DEFAULT_DESCR, 'examples' => array("{e_PLUGIN_ABS}forum/forum_viewtopic.php?id=3&p=2")), 'form' => array(), 'callbacks' => array());
return $admin;
}
示例4: sc_admin_lang
function sc_admin_lang($parm)
{
if (!ADMIN || !e107::getPref('multilanguage')) {
return '';
}
$e107 = e107::getInstance();
$sql = e107::getDb();
$pref = e107::getPref();
$ns = e107::getRender();
e107::plugLan('user_menu', '', true);
$params = array();
parse_str($parm, $params);
$lanlist = explode(',', e_LANLIST);
sort($lanlist);
$text = '';
$lanperms = array();
foreach ($lanlist as $langval) {
if (getperms($langval)) {
$lanperms[] = $langval;
}
}
$slng = e107::getLanguage();
if (!getperms($sql->mySQLlanguage) && $lanperms) {
$slng->set($lanperms[0]);
if ($pref['user_tracking'] == "session" && $pref['multilanguage_subdomain']) {
e107::getRedirect()->redirect($slng->subdomainUrl($lanperms[0]));
}
/*$sql->mySQLlanguage = ($lanperms[0] != $pref['sitelanguage']) ? $lanperms[0] : "";
if ($pref['user_tracking'] == "session")
{
$_SESSION['e107language_'.$pref['cookie_name']] = $lanperms[0];
if($pref['multilanguage_subdomain']){
header("Location:".$slng->subdomainUrl($lanperms[0]));
}
}
else
{
setcookie('e107language_'.$pref['cookie_name'], $lanperms[0], time() + 86400, '/');
$_COOKIE['e107language_'.$pref['cookie_name']]= $lanperms[0];
}*/
}
if (varset($GLOBALS['mySQLtablelist'])) {
foreach ($GLOBALS['mySQLtablelist'] as $tabs) {
$clang = strtolower($sql->mySQLlanguage);
if (strpos($tabs, "lan_" . $clang) && $clang != "") {
$aff[] = str_replace(MPREFIX . "lan_" . $clang . "_", "", $tabs);
}
}
}
$text .= "\n\t\t<div>\n\t\t";
if (isset($aff)) {
$text .= $sql->mySQLlanguage;
$text .= " (" . $slng->convert($sql->mySQLlanguage) . ")\n\t\t\t: <span class='btn btn-default button' style='cursor: pointer;' onclick='expandit(\"lan_tables\");'><a style='text-decoration:none' title='' href=\"javascript:void(0);\" > " . count($aff) . " " . UTHEME_MENU_L3 . " </a></span><br />\n\t\t\t<span style='display:none' id='lan_tables'>\n\t\t\t";
$text .= implode('<br />', $aff);
$text .= '</span>';
} elseif ($sql->mySQLlanguage && $sql->mySQLlanguage != $pref['sitelanguage']) {
$text .= $sql->mySQLlanguage;
$text .= ' (' . $slng->convert($sql->mySQLlanguage) . '): ' . LAN_INACTIVE;
} else {
$text .= $pref['sitelanguage'];
}
$text .= "<br /><br /></div>";
$select = '';
if (isset($pref['multilanguage_subdomain']) && $pref['multilanguage_subdomain']) {
// TODO - JS independent
$select .= "\n\t\t\t<select class='tbox' name='lang_select' id='sitelanguage' onchange=\"location.href=this.options[selectedIndex].value\">";
foreach ($lanperms as $lng) {
$selected = $lng == $sql->mySQLlanguage || $lng == $pref['sitelanguage'] && !$sql->mySQLlanguage ? " selected='selected'" : "";
$urlval = $slng->subdomainUrl($lng);
$select .= "<option value='" . $urlval . "' {$selected}>{$lng}</option>\n";
}
$select .= "</select>";
} else {
$select .= "\n\t\t\t<form method='post' action='" . e_SELF . (e_QUERY ? '?' . e_QUERY : '') . "'>\n\t\t\t<div>\n\t\t\t<select name='sitelanguage' id='sitelanguage' class='tbox' onchange='this.form.submit()'>";
foreach ($lanperms as $lng) {
// FIXME - language detection is a mess - db handler, mysql handler, session handler and language handler + constants invlolved
// Too complex, doesn't work!!! SIMPLIFY!!!
//$langval = ($lng == $pref['sitelanguage'] && $lng == 'English') ? "" : $lng;
//$selected = ($lng == $sql->mySQLlanguage || ($lng == $pref['sitelanguage'] && !$sql->mySQLlanguage)) ? " selected='selected'" : "";
//$select .= "<option value='".$langval."'{$selected}>$lng</option>\n";
$selected = $lng == e_LANGUAGE ? " selected='selected'" : "";
$select .= "<option value='" . $lng . "'{$selected}>{$lng}</option>\n";
}
$select .= "</select> " . (!isset($params['nobutton']) ? "<button class='update e-hide-if-js' type='submit' name='setlanguage' value='no-value'><span>" . UTHEME_MENU_L1 . "</span></button>" : '') . "\n\t\t\t" . e107::getForm()->hidden('setlanguage', '1') . "\n\t\t\t</div>\n\t\t\t</form>\n\t\t\t";
}
if (isset($params['nomenu'])) {
return $select;
}
if ($select) {
$text .= "<div class='center'>{$select}</div>";
}
return $ns->tablerender(UTHEME_MENU_L2, $text, '', true);
}
示例5: md5
<?php
/**
* Copyright (C) 2008-2011 e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id$
*
* News categories menu
*/
if (!defined('e107_INIT')) {
exit;
}
$cacheString = 'nq_news_categories_menu_' . md5(serialize($parm));
$cached = e107::getCache()->retrieve($cacheString);
if (false === $cached) {
e107::plugLan('news');
if (is_string($parm)) {
parse_str($parm, $parms);
} else {
$parms = $parm;
}
$ctree = e107::getObject('e_news_category_tree', null, e_HANDLER . 'news_class.php');
$template = e107::getTemplate('news', 'news_menu', 'category');
$cached = $ctree->loadActive()->render($template, $parms, true);
e107::getCache()->set($cacheString, $cached);
}
echo $cached;
示例6:
<?php
/*
* Copyright (c) 2012 e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: e_shortcode.php 12438 2011-12-05 15:12:56Z secretr $
*
* Gallery Template
*/
if (!defined('e107_INIT')) {
exit;
}
e107::plugLan('gallery', 'front');
$gp = e107::getPlugPref('gallery');
e107::js('gallery', 'jslib/prettyPhoto/js/jquery.prettyPhoto.js', 'jquery');
e107::css('gallery', 'jslib/prettyPhoto/css/prettyPhoto.css', 'jquery');
e107::css('gallery', 'gallery_style.css');
// Work-around for indent issue. see: https://github.com/twitter/bootstrap/issues/4890
e107::css('inline', "\r\n\r\n.thumbnails .span2:nth-child(6n+1) {\r\nmargin-left:0;\r\n}", 'jquery');
$prettyPhoto = <<<JS
\$(document).ready(function(){
\$("a[data-gal^='prettyPhoto']").prettyPhoto(
\t {
\t \thook: 'data-gal',
\t \ttheme: 'pp_default',
\t \toverlay_gallery: false,
\t \tdeeplinking: false
\t }
);
});
JS;
e107::js('footer-inline', $prettyPhoto, 'jquery');
示例7: plugin_viewscan
/**
* Plugin Folder Scanner
* @return none
*/
private function plugin_viewscan($mode = 'update')
{
$error_messages = array(0 => DBLAN_31, 1 => LAN_ERROR, 2 => DBLAN_33, 3 => DBLAN_34);
// $error_image = array("integrity_pass.png", "integrity_fail.png", "warning.png", "blank.png");
$error_glyph = array(ADMIN_TRUE_ICON, ADMIN_FALSE_ICON, "<i class='S16 e-warning-16'></i>", "<i style='display:inline-block;width:17px;height:16px;'> </i>");
$error_type = array('warning' => 2, 'error' => 1);
global $e107;
$sql = e107::getDb();
$tp = e107::getParser();
$frm = e107::getForm();
$mes = e107::getMessage();
require_once e_HANDLER . "plugin_class.php";
$ep = new e107plugin();
$ep->update_plugins_table($mode);
// scan for e_xxx changes and save to plugin table.
$ep->save_addon_prefs($mode);
// generate global e_xxx_list prefs from plugin table.
/* we all are awaiting for PHP5 only support - method chaining...
$mes->add(DBLAN_22.' - '.DBLAN_23, E_MESSAGE_SUCCESS)
->add("<a href='".e_SELF."'>".LAN_BACK."</a>", E_MESSAGE_SUCCESS)
->add(DBLAN_30);
*/
$mes->add(DBLAN_23, E_MESSAGE_SUCCESS);
$mes->add("<a href='" . e_SELF . "'>" . LAN_BACK . "</a>", E_MESSAGE_SUCCESS);
$mes->add(DBLAN_30);
$text = "\n\t\t\t\t<form method='post' action='" . e_ADMIN . "db.php?mode=" . $_GET['mode'] . "' id='plug_edit'>\n\t\t\t\t\t<fieldset id='core-db-plugin-scan'>\n\t\t\t\t\t\t<legend class='e-hideme'>" . ADLAN_CL_7 . "</legend>\n\t\t\t\t\t\t<table class='table adminlist'>\n\t\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t\t<col style='width: 20%' />\n\t\t\t\t\t\t\t\t<col style='width: 20%' />\n\t\t\t\t\t\t\t\t<col style='width: 35%' />\n\t\t\t\t\t\t\t\t<col style='width: 25%' />\n\t\t\t\t\t\t\t</colgroup>\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th>" . LAN_NAME . "</th>\n\t\t\t\t\t\t\t\t\t<th>" . DBLAN_25 . "</th>\n\t\t\t\t\t\t\t\t\t<th>" . DBLAN_26 . "</th>\n\t\t\t\t\t\t\t\t\t<th class='center last'>" . DBLAN_27 . "</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t";
$sql->select("plugin", "*", "plugin_id !='' order by plugin_path ASC");
// Must order by path to pick up duplicates. (plugin names may change).
$previous = '';
while ($row = $sql->fetch()) {
e107::loadLanFiles($row['plugin_path'], 'admin');
e107::plugLan($row['plugin_path'], 'global', true);
$text .= "\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>" . $tp->toHtml($row['plugin_name'], FALSE, "defs,emotes_off") . "</td>\n\t \t\t\t\t\t<td>" . $row['plugin_path'] . "</td>\n\t\t\t\t\t\t\t\t\t<td>";
if (trim($row['plugin_addons'])) {
//XXX - $nl_code = ''; - OLD VAR?
foreach (explode(',', $row['plugin_addons']) as $this_addon) {
$ret_code = 3;
// Default to 'not checked
if (strpos($this_addon, 'e_') === 0 || substr($this_addon, -4, 4) == '_sql') {
$ret_code = $ep->checkAddon($row['plugin_path'], $this_addon);
// See whether spaces before opening tag or after closing tag
} elseif (strpos($this_addon, 'sc_') === 0) {
$this_addon = substr($this_addon, 3) . ' (sc)';
}
if (!is_numeric($ret_code)) {
$errorMessage = $ret_code['msg'];
$ret_code = $error_type[$ret_code['type']];
} else {
$errorMessage = $error_messages[$ret_code];
}
$text .= "<span class='clear e-tip' style='cursor:pointer' title='" . $errorMessage . "'>";
$text .= $error_glyph[$ret_code] . " ";
// $text .= "<img class='icon action S16' src='".e_IMAGE_ABS."fileinspector/".$error_image[$ret_code]."' alt='".$error_messages[$ret_code]."' title='".$error_messages[$ret_code]."' />";
$text .= trim($this_addon);
// $ret_code - 0=OK, 1=content error, 2=access error
$text .= "</span><br />";
}
}
$text .= "\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class='center'>\n\t\t\t\t";
if ($previous == $row['plugin_path']) {
$delid = $row['plugin_id'];
$delname = $row['plugin_name'];
//Admin delete button
$text .= $frm->admin_button("delplug[{$delid}]", DBLAN_52, 'delete', '', array('title' => LAN_CONFIRMDEL . " ID:{$delid} [{$delname}]"));
//Or maybe image submit? -
//$text .= $frm->submit_image("delplug[{$delid}]", DBLAN_52, 'delete', LAN_CONFIRMDEL." ID:{$delid} [$delname]");
} else {
$text .= $row['plugin_installflag'] == 1 ? "<span class='label label-warning'>" . DBLAN_27 . "</span>" : " ";
// "Installed and not installed";
}
$text .= "\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t";
$previous = $row['plugin_path'];
}
$text .= "\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\n\t\t\t";
e107::getRender()->tablerender(DBLAN_10 . SEP . DBLAN_22, $mes->render() . $text);
}
示例8: unset
// FASTEST - ALWAYS load
}
$customLan = e_LANGUAGEDIR . e_LANGUAGE . '/' . e_LANGUAGE . '_custom.php';
if (is_readable($customLan)) {
include $customLan;
}
// v2 Custom language File Path.
$customLan2 = e_SYSTEM . '/lans/' . e_LANGUAGE . '_custom.php';
if (is_readable($customLan2)) {
include $customLan2;
}
unset($customLan, $customLan2);
$sql->db_Mark_Time('Start: Global Language Files');
if (isset($pref['lan_global_list'])) {
foreach ($pref['lan_global_list'] as $path) {
e107::plugLan($path, 'global', true);
}
}
$sql->db_Mark_Time('Start: CHAP challenge');
$die = e_AJAX_REQUEST == true ? false : true;
e107::getSession()->challenge()->check($die);
// Token protection
unset($die);
//
// N: misc setups: online user tracking, cache
//
$sql->db_Mark_Time('Start: Misc resources. Online user tracking, cache');
/**
* @deprecated BC, call the method only when needed, $e107->ecache caught by __get()
*/
$e107cache = e107::getCache();
示例9: admin
/**
* Admin callback
* Language file not loaded as all language data is inside the lan_eurl.php (loaded by default on administration URL page)
*/
public function admin()
{
// static may be used for performance
e107::plugLan('forum', 'lan_forum_url');
static $admin = array('labels' => array('name' => FORUM_LAN_URL_NAME, 'label' => FORUM_LAN_URL_REWRITE_LABEL, 'description' => FORUM_LAN_URL_REWRITE_DESCR), 'form' => array(), 'callbacks' => array());
return $admin;
}
示例10: admin
/**
* Admin callback
* Language file not loaded as all language data is inside the lan_eurl.php (loaded by default on administration URL page)
*/
public function admin()
{
// static may be used for performance
e107::plugLan('pm', 'admin_pm', true);
static $admin = array('labels' => array('name' => ADLAN_PM, 'label' => ADLAN_PM_URL_DEFAULT_LABEL, 'description' => ADLAN_PM_URL_DEFAULT_DESCR), 'form' => array(), 'callbacks' => array());
return $admin;
}
示例11: md5
}
$cString = 'nq_news_months_menu_' . md5($parm);
$cached = e107::getCache()->retrieve($cString);
if (false === $cached) {
if (!function_exists('newsFormatDate')) {
function newsFormatDate($year, $month, $day = "")
{
$date = $year;
$date .= strlen($month) < 2 ? "0" . $month : $month;
$date .= strlen($day) < 2 && $day != "" ? "0" . $day : $day;
return $date;
}
}
//parse_str($parm, $parms); // FIXME - menu settings...
$parms['showarchive'] = 0;
e107::plugLan('blogcalendar_menu');
$tp = e107::getParser();
$sql = e107::getDb();
$marray = array(BLOGCAL_M1, BLOGCAL_M2, BLOGCAL_M3, BLOGCAL_M4, BLOGCAL_M5, BLOGCAL_M6, BLOGCAL_M7, BLOGCAL_M8, BLOGCAL_M9, BLOGCAL_M10, BLOGCAL_M11, BLOGCAL_M12);
// TODO parms
//$parms['year'] = "2011 0";
if (vartrue($parms['year'])) {
$date = $parms['year'];
list($cur_year, $cur_month) = explode(" ", date($date));
$start = mktime(0, 0, 0, 1, 1, $cur_year);
$end = mktime(23, 59, 59, 12, 31, $cur_year);
} else {
$date = "Y n";
list($cur_year, $cur_month) = explode(" ", date($date));
$start = mktime(0, 0, 0, 1, 1, $cur_year);
$end = time();
示例12: init
public function init()
{
e107::plugLan('gallery', 'front');
$this->catList = e107::getMedia()->getCategories('gallery');
}
示例13: admin
/**
* Admin callback
* Language file not loaded as all language data is inside the lan_eurl.php (loaded by default on administration URL page)
*/
public function admin()
{
// static may be used for performance
e107::plugLan('pm', 'admin_pm', true);
static $admin = array('labels' => array('name' => LAN_PLUGIN_PM_NAME, 'label' => LAN_PLUGIN_PM_URL_DEFAULT_LABEL, 'description' => LAN_PLUGIN_PM_URL_DEFAULT_DESCR, 'examples' => array("{e_PLUGIN_ABS}pm/pm.php")), 'form' => array(), 'callbacks' => array());
return $admin;
}