本文整理汇总了PHP中e107::getPlugConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getPlugConfig方法的具体用法?PHP e107::getPlugConfig怎么用?PHP e107::getPlugConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::getPlugConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*/
function __construct()
{
if (USERID > 0) {
$this->plugPrefs = e107::getPlugConfig('nodejs_online')->getPref();
$this->include_components();
}
}
示例2: __construct
/**
* Constructor.
*/
function __construct()
{
if (USER) {
$this->plugPrefs = e107::getPlugConfig('nodejs_online')->getPref();
$this->renderMenu();
}
}
示例3: __construct
public function __construct()
{
$this->e107 = e107::getInstance();
$this->userViewed = array();
$this->modArray = array();
$this->loadPermList();
$this->prefs = e107::getPlugConfig('forum');
if (!$this->prefs->get('postspage')) {
$this->setDefaults();
}
// var_dump($this->prefs);
/*
$this->fieldTypes['forum_post']['post_user'] = 'int';
$this->fieldTypes['forum_post']['post_forum'] = 'int';
$this->fieldTypes['forum_post']['post_datestamp'] = 'int';
$this->fieldTypes['forum_post']['post_edit_datestamp'] = 'int';
$this->fieldTypes['forum_post']['post_edit_user'] = 'int';
$this->fieldTypes['forum_post']['post_thread'] = 'int';
$this->fieldTypes['forum_post']['post_options'] = 'escape';
$this->fieldTypes['forum_post']['post_attachments'] = 'escape';
$this->fieldTypes['forum_thread']['thread_user'] = 'int';
$this->fieldTypes['forum_thread']['thread_lastpost'] = 'int';
$this->fieldTypes['forum_thread']['thread_lastuser'] = 'int';
$this->fieldTypes['forum_thread']['thread_sticky'] = 'int';
$this->fieldTypes['forum_thread']['thread_forum_id'] = 'int';
$this->fieldTypes['forum_thread']['thread_active'] = 'int';
$this->fieldTypes['forum_thread']['thread_datestamp'] = 'int';
$this->fieldTypes['forum_thread']['thread_views'] = 'int';
$this->fieldTypes['forum_thread']['thread_replies'] = 'int';
$this->fieldTypes['forum_thread']['thread_options'] = 'escape';
$this->fieldTypes['forum']['forum_lastpost_user'] = 'int';
*/
}
示例4: db_update_menu
/**
* database update settings
*
* @return string $message
*
*/
function db_update_menu()
{
// $sql = e107::getDb();
// $tp = e107::getParser();
// Get the preferences so we've got a reference for changes
// $list_pref = $this->parent->getListPrefs();
// $temp = array();
// while(list($key, $value) = each($_POST))
// {
// if($value != LIST_ADMIN_2){ $temp[$tp->toDB($key)] = $tp->toDB($value); }
// }
e107::getPlugConfig('list_new')->reset()->setPref($_POST)->save(true);
// retrieve with e107::pref('list_new');
return;
/*
if ($this->e107->admin_log->logArrayDiffs($temp, $list_pref, 'LISTNEW_01'))
{
$tmp = $this->e107->arrayStorage->WriteArray($list_pref);
$sql->update("core", "e107_value='{$tmp}' WHERE e107_name='list' ");
$message = LIST_ADMIN_3;
}
else
{
$message = LIST_ADMIN_17;
}
return $message;
*/
}
示例5: nodejs_forum_event_user_forum_post_created_callback
/**
* Event callback after triggering "user_forum_post_created".
*
* @param array $info
* Details about forum post.
*/
function nodejs_forum_event_user_forum_post_created_callback($info)
{
$postID = intval(vartrue($info['data']['post_id'], 0));
$postUserID = intval(vartrue($info['data']['post_user'], 0));
$postThreadID = intval(vartrue($info['data']['post_thread'], 0));
if ($postID === 0 || $postThreadID === 0) {
return;
}
// Get forum plugin preferences.
$plugForumPrefs = e107::getPlugConfig('forum')->getPref();
$db = e107::getDb();
// Load thread.
$thread = $db->retrieve('forum_thread', '*', 'thread_id = ' . $postThreadID);
$threadUser = intval(vartrue($thread['thread_user'], 0));
// Load forum to check (read) permission.
$forum = $db->retrieve('forum', '*', 'forum_id = ' . intval(vartrue($thread['thread_forum_id'], 0)));
// Author of the forum post.
$authorPost = e107::user($postUserID);
// Author of the forum topic.
$authorThread = e107::user($threadUser);
e107_require_once(e_PLUGIN . 'nodejs/nodejs.main.php');
$template = e107::getTemplate('nodejs_forum');
$sc = e107::getScBatch('nodejs_forum', true);
$tp = e107::getParser();
// Get topic page number.
$postNum = $db->count('forum_post', '(*)', "WHERE post_id <= " . $postID . " AND post_thread = " . $postThreadID . " ORDER BY post_id ASC");
$postPage = ceil($postNum / vartrue($plugForumPrefs['postspage'], 10));
// Push rendered row item into Latest Forum Posts menu.
$sc_vars = array('author' => $authorPost, 'post' => $info['data'], 'thread' => $thread, 'topicPage' => $postPage);
$sc->setVars($sc_vars);
$markup = $tp->parseTemplate($template['MENU']['RECENT']['ITEM'], true, $sc);
$message = (object) array('broadcast' => true, 'channel' => 'nodejs_notify', 'callback' => 'nodejsForumMenu', 'type' => 'latestForumPosts', 'markup' => $markup);
nodejs_enqueue_message($message);
// Broadcast logged in users to inform about new forum post created.
if ($authorPost) {
$sc->setVars($sc_vars);
$markup = $tp->parseTemplate($template['NOTIFICATION']['POST_ALL'], true, $sc);
// It's a public forum, so broadcast every online user.
if (intval(vartrue($forum['forum_class'], 0)) === 0) {
$message = (object) array('broadcast' => true, 'channel' => 'nodejs_notify', 'callback' => 'nodejsForum', 'type' => 'newForumPostAny', 'markup' => $markup, 'exclude' => $postUserID);
nodejs_enqueue_message($message);
} else {
$forumClass = vartrue($forum['forum_class'], 0);
$db->select('nodejs_presence');
while ($row = $db->fetch()) {
if (isset($row['uid']) && check_class($forumClass, null, $row['uid'])) {
$message = (object) array('channel' => 'nodejs_user_' . $row['uid'], 'callback' => 'nodejsForum', 'type' => 'newForumPostAny', 'markup' => $markup, 'exclude' => $postUserID);
nodejs_enqueue_message($message);
}
}
}
}
// Broadcast logged in (thread-author) user to inform about new forum post created in his/her topic.
if (isset($authorThread['user_id'])) {
$sc->setVars($sc_vars);
$markup = $tp->parseTemplate($template['NOTIFICATION']['POST_OWN'], true, $sc);
$message = (object) array('channel' => 'nodejs_user_' . $authorThread['user_id'], 'callback' => 'nodejsForum', 'type' => 'newForumPostOwn', 'markup' => $markup, 'exclude' => $postUserID);
nodejs_enqueue_message($message);
}
}
示例6: __construct
/**
* Constructor.
*/
function __construct()
{
if (e107::isInstalled('nodejs_comment')) {
// Get plugin preferences.
$this->plugPrefs = e107::getPlugConfig('nodejs_comment')->getPref();
$this->renderMenu();
}
}
示例7: sc_faq_submit_question
function sc_faq_submit_question()
{
$faqpref = e107::getPlugConfig('faqs')->getPref();
$frm = e107::getForm();
if (check_class($faqpref['add_faq'])) {
$text = "<div class='faq-submit-question-container'><a class='e-expandit faq-submit-question' href='faqs.php'>Submit a Question</a>\n\t\t\t<div class='e-hideme faq-submit-question-form'>\n\t\t\t<form method=\"post\" action=\"" . e_SELF . "?cat.{$id}.{$idx}\" id=\"dataform\">\n\t\t\t<div>" . $frm->textarea('ask_a_question', '') . '<br />' . $frm->submit('submit_a_question', 'Go') . "</div>\n\t\t\t</form>\n\t\t\t</div>\n\t\t\t</div>\t\t\t\n\t\t\t";
return $text;
}
}
示例8: __construct
/**
* Constructor.
*/
public function __construct()
{
// Get plugin preferences.
$this->plugPrefs = e107::getPlugConfig('paypal_donation')->getPref();
$ipn = $this->readIPN();
$valid = $this->validateIPN($ipn);
if ($valid === true) {
$this->processIPN();
}
}
示例9: __construct
/**
* Constructor.
*/
function __construct()
{
// Get plugin preferences.
$this->plugPrefs = e107::getPlugConfig('paypal_donation')->getPref();
if (vartrue($_POST['donation'], false)) {
if ($this->formValidate()) {
$this->formSubmit();
}
}
// Render menu.
$this->renderMenu();
}
示例10: __construct
/**
* Constructor.
*/
function __construct()
{
// Include necessary CSS and JS files regardless of whether the current user is logged in, or not.
$this->includePublicComponents();
if (USERID > 0) {
$db = e107::getDb();
// Plugin preferences.
$this->plugPrefs = e107::getPlugConfig('nodejs_comment')->getPref();
// Extended User Fields values by current, logged in user.
$this->defaultValues = $db->retrieve('user_extended', '*', 'user_extended_id = ' . USERID);
// Include necessary CSS and JS files only for logged in user.
$this->includePrivateComponents();
}
}
示例11: __construct
public function __construct($update = false)
{
if (!empty($_POST['fjsubmit']) && !empty($_POST['forumjump'])) {
$url = e107::getParser()->filter($_POST['forumjump'], 'url');
e107::getRedirect()->go($_POST['forumjump']);
exit;
}
$this->e107 = e107::getInstance();
$tp = e107::getParser();
$this->userViewed = array();
$this->modArray = array();
if ($update === false) {
$this->loadPermList();
}
$this->prefs = e107::getPlugConfig('forum');
if (!$this->prefs->get('postspage')) {
$this->setDefaults();
}
// var_dump($this->prefs);
/*
$this->fieldTypes['forum_post']['post_user'] = 'int';
$this->fieldTypes['forum_post']['post_forum'] = 'int';
$this->fieldTypes['forum_post']['post_datestamp'] = 'int';
$this->fieldTypes['forum_post']['post_edit_datestamp'] = 'int';
$this->fieldTypes['forum_post']['post_edit_user'] = 'int';
$this->fieldTypes['forum_post']['post_thread'] = 'int';
$this->fieldTypes['forum_post']['post_options'] = 'escape';
$this->fieldTypes['forum_post']['post_attachments'] = 'escape';
$this->fieldTypes['forum_thread']['thread_user'] = 'int';
$this->fieldTypes['forum_thread']['thread_lastpost'] = 'int';
$this->fieldTypes['forum_thread']['thread_lastuser'] = 'int';
$this->fieldTypes['forum_thread']['thread_sticky'] = 'int';
$this->fieldTypes['forum_thread']['thread_forum_id'] = 'int';
$this->fieldTypes['forum_thread']['thread_active'] = 'int';
$this->fieldTypes['forum_thread']['thread_datestamp'] = 'int';
$this->fieldTypes['forum_thread']['thread_views'] = 'int';
$this->fieldTypes['forum_thread']['thread_replies'] = 'int';
$this->fieldTypes['forum_thread']['thread_options'] = 'escape';
$this->fieldTypes['forum']['forum_lastpost_user'] = 'int';
*/
}
示例12: pref_editor
/**
* Preferences Editor
* @return string text for display
*/
private function pref_editor($type = 'core')
{
//TODO Add drop-down for editing personal perfs also. ie. user pref of self. (admin)
global $pref, $e107, $emessage, $frm;
$config = $type == 'core' ? e107::getConfig('core') : e107::getPlugConfig($type);
$spref = $config->getPref();
ksort($spref);
$text = "\n\t\t\t\t<form method='post' action='" . e_ADMIN . "db.php?mode=" . $_GET['mode'] . "&type=" . $type . "' id='pref_edit'>\n\t\t\t\t\t<fieldset id='core-db-pref-edit'>\n\t\t\t\t\t\t<legend class='e-hideme'>" . DBLAN_20 . "</legend>";
$text .= "<select class='tbox' name='type_select' onchange='urljump(this.options[selectedIndex].value)' >\n\t\t<option value='" . e_ADMIN . "db.php?mode=" . $_GET['mode'] . "&type=core'>Core</option>\n";
// e107::getConfig($type)->aliases
e107::getDb()->db_Select_gen("SELECT e107_name FROM #core WHERE e107_name LIKE ('plugin_%') ORDER BY e107_name");
while ($row = e107::getDb()->db_Fetch()) {
$key = str_replace("plugin_", "", $row['e107_name']);
$selected = varset($_GET['type']) == $key ? "selected='selected'" : "";
$text .= "<option value='" . e_ADMIN . "db.php?mode=" . $_GET['mode'] . "&type=" . $key . "' {$selected}>" . ucwords($key) . "</option>\n";
}
$text .= "</select></div>\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: 5%' />\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: 70%' />\n\t\t\t\t\t\t\t\t<col style='width: 5%' />\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 class='center'>" . LAN_DELETE . "</th>\n\t\t\t\t\t\t\t\t\t<th>" . DBLAN_17 . "</th>\n\t\t\t\t\t\t\t\t\t<th>" . DBLAN_18 . "</th>\n\t\t\t\t\t\t\t\t\t<th class='center last'>" . LAN_OPTIONS . "</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";
foreach ($spref as $key => $val) {
$ptext = is_array($val) ? "<pre>" . print_r($val, TRUE) . "</pre>" : htmlspecialchars($val, ENT_QUOTES, 'utf-8');
$ptext = $e107->tp->textclean($ptext, 80);
$text .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='center autocheck e-pointer'>" . $frm->checkbox("delpref2[{$key}]", 1) . "</td>\n\t\t\t\t\t<td>{$key}</td>\n\t\t\t\t\t<td>{$ptext}</td>\n\t\t\t\t\t<td class='center'>" . $frm->submit_image("delpref[{$key}]", LAN_DELETE, 'delete', LAN_CONFIRMDEL . " [{$key}]") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t";
}
$text .= "\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<div class='buttons-bar center'>\n\t\t\t\t\t\t\t" . $frm->admin_button('delpref_checked', LAN_DELCHECKED, 'delete') . "\n\t\t\t\t\t\t\t" . $frm->admin_button('back', LAN_BACK, 'back') . "\n\t\t\t\t\t\t\t<input type='hidden' name='pref_type' value='" . $type . "' />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\n\n";
e107::getRender()->tablerender(DBLAN_10 . ' :: ' . DBLAN_20 . " :: " . ucwords($type), $emessage->render() . $text);
return $text;
}
示例13: XmlPrefs
/**
* Process XML tags <mainPrefs> and <pluginPrefs>
* @param object $mode 'core' or the folder name of the plugin.
* @param object $function install|uninstall|upgrade|refresh
* @param object $prefArray XML array of prefs. eg. mainPref() or pluginPref();
* @return none
*/
function XmlPrefs($mode = 'core', $function, $prefArray)
{
//XXX Could also be used for theme prefs.. perhaps this function should be moved elsewhere?
//TODO array support for prefs. <key>? or array() as used in xml site export?
$mes = e107::getMessage();
if (!varset($prefArray) || !varset($prefArray)) {
return;
}
$config = $mode == 'core' ? e107::getConfig('core') : e107::getPlugConfig($mode);
foreach ($prefArray['pref'] as $tag) {
$key = varset($tag['@attributes']['name']);
$value = vartrue($tag['@value']);
if (substr($value, 0, 5) == "e_UC_") {
$value = constant($value);
}
$remove = varset($tag['@attributes']['deprecate']) == 'true' ? TRUE : FALSE;
if (varset($tag['@attributes']['value'])) {
$mes->addError("Deprecated plugin.xml spec. found. Use the following format: " . htmlentities("<pref name='name'>value</pref>"));
}
switch ($function) {
case 'install':
case 'upgrade':
$ret = $config->add($key, $value);
if ($ret->data_has_changed == TRUE) {
$mes->addSuccess("Adding Pref: " . $key);
}
break;
case 'refresh':
if ($remove) {
$config->remove($key, $value);
$mes->addSuccess("Removing Pref: " . $key);
} else {
$config->update($key, $value);
$mes->addSuccess("Updating Pref: " . $key);
}
break;
case 'uninstall':
$config->remove($key, $value);
$mes->addSuccess("Removing Pref: " . $key);
break;
}
}
if ($mode != "core") {
$config->save(true, false, false);
}
return;
}
示例14: array
/**
* Returns information about registered libraries.
*
* The returned information is unprocessed; i.e., as registered by plugins.
*
* @param $library
* (optional) The machine name of a library to return registered information for. If omitted, information about all
* registered libraries is returned.
*
* @return array|false
* An associative array containing registered information for all libraries, the registered information for the
* library specified by $name, or FALSE if the library $name is not registered.
*/
function &libraries_info($library = null)
{
// This static cache is re-used by libraries_detect() to save memory.
static $libraries;
if (!isset($libraries)) {
$libraries = array();
$plugPrefs = e107::getPlugConfig('libraries')->getPref();
$addonsList = vartrue($plugPrefs['addon_list'], array());
// Gather information from libraries_info() in enabled plugins/themes.
foreach ($addonsList as $type => $items) {
foreach ($items as $name) {
if ($type == 'plugin') {
e107_require_once(e_PLUGIN . $name . '/e_libraries.php');
}
if ($type == 'theme') {
e107_require_once(e_THEME . $name . '/e_libraries.php');
}
$addonClass = $name . '_libraries';
if (class_exists($addonClass)) {
$class = new $addonClass();
if (method_exists($class, 'libraries_info')) {
$info = $class->libraries_info();
if (is_array($info)) {
foreach ($info as $machine_name => $properties) {
if ($type == 'plugin') {
$properties['info type'] = 'plugin';
$properties['plugin'] = $name;
$libraries[$machine_name] = $properties;
}
if ($type == 'theme') {
$properties['info type'] = 'theme';
$properties['theme'] = $name;
$libraries[$machine_name] = $properties;
}
}
}
}
}
}
}
// Provide defaults.
foreach ($libraries as $machine_name => &$properties) {
libraries_info_defaults($properties, $machine_name);
}
// Allow enabled plugins/themes to alter the registered libraries.
foreach ($addonsList as $type => $items) {
foreach ($items as $name) {
if ($type == 'plugin') {
e107_require_once(e_PLUGIN . $name . '/e_libraries.php');
}
if ($type == 'theme') {
e107_require_once(e_THEME . $name . '/e_libraries.php');
}
$addonClass = $name . '_libraries';
if (class_exists($addonClass)) {
$class = new $addonClass();
if (method_exists($class, 'libraries_info_alter')) {
$class->libraries_info_alter($libraries);
}
}
}
}
// TODO:
// Invoke callbacks in the 'info' group.
foreach ($libraries as &$properties) {
libraries_invoke('info', $properties);
}
}
if (isset($library)) {
if (!empty($libraries[$library])) {
return $libraries[$library];
} else {
$false = false;
return $false;
}
}
return $libraries;
}
示例15: __construct
/**
* Constructor.
*/
function __construct()
{
parent::__construct();
// Get plugin preferences.
$this->plugPrefs = e107::getPlugConfig('paypal_donation')->getPref();
}