本文整理汇总了PHP中PHPWS_Core::requireConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Core::requireConfig方法的具体用法?PHP PHPWS_Core::requireConfig怎么用?PHP PHPWS_Core::requireConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_Core
的用法示例。
在下文中一共展示了PHPWS_Core::requireConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Faxmaster
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @author Jeremy Booker <jbooker at tux dot appstate dot edu>
*/
if (!defined('PHPWS_SOURCE_DIR')) {
include '../../config/core/404.html';
exit;
}
# Include configuration and defines
PHPWS_Core::requireInc('faxmaster', 'defines.php');
PHPWS_Core::requireInc('faxmaster', 'errordefines.php');
PHPWS_Core::requireConfig('faxmaster');
Layout::addStyle('faxmaster');
/* The user must be logged in to use this module. So, if
* there's no user session, or the user is not logged
* in, then return here
*/
if ((!isset($_SESSION['User']) || !Current_User::isLogged()) && (!isset($_REQUEST['op']) || $_REQUEST['op'] != 'new_fax')) {
return;
}
# Create the Faxmaster
PHPWS_Core::initModClass('faxmaster', 'Faxmaster.php');
$fm = new Faxmaster();
示例2: adminMenu
<?php
/**
* @author Matthew McNaney <mcnaney at gmail dot com>
* @version $Id$
*/
PHPWS_Core::requireInc('signup', 'errordefines.php');
PHPWS_Core::requireConfig('signup');
if (!defined('SIGNUP_WINDOW')) {
define('SIGNUP_WINDOW', 3600);
}
class Signup
{
public $forms = null;
public $panel = null;
public $title = null;
public $message = null;
public $content = null;
public $sheet = null;
public $slot = null;
public $peep = null;
public $email = null;
public function adminMenu()
{
if (!Current_User::allow('signup')) {
Current_User::disallow();
}
$this->loadPanel();
$javascript = false;
$this->loadMessage();
$command = $_REQUEST['aop'];
示例3: repeatDaily
public function repeatDaily(Calendar_Event $event)
{
PHPWS_Core::requireConfig('calendar');
$dst_start = date('I', $event->start_time);
$time_unit = $event->start_time + 86400;
$copy_event = $event->repeatClone();
$time_diff = $event->end_time - $event->start_time;
$max_count = 0;
while ($time_unit <= $event->end_repeat) {
$copy_event->id = 0;
$dst_current = date('I', $time_unit);
if ($dst_current != $dst_start) {
if ($dst_current) {
$time_unit -= 3600;
} else {
$time_unit += 3600;
}
$dst_start = $dst_current;
}
$max_count++;
if ($max_count > CALENDAR_MAXIMUM_REPEATS) {
return PHPWS_Error::get(CAL_REPEAT_LIMIT_PASSED, 'calendar', 'Calendar_Admin::repeatDaily');
}
$copy_event->start_time = $time_unit;
$copy_event->end_time = $time_unit + $time_diff;
$time_unit += 86400;
$result = $copy_event->save();
if (PHPWS_Error::isError($result)) {
return $result;
}
}
return true;
}
示例4:
<?php
/**
* Main command class for Calendar module
*
* @author Matthew McNaney <mcnaney at gmail dot com>
* @version $Id$
*/
PHPWS_Core::requireConfig('calendar');
PHPWS_Core::requireInc('calendar', 'error_defines.php');
define('MINI_CAL_NO_SHOW', 0);
define('MINI_CAL_SHOW_FRONT', 1);
define('MINI_CAL_SHOW_ALWAYS', 2);
class PHPWS_Calendar
{
/**
* unix timestamp of today
* @var integer
*/
public $today = 0;
/**
* unix timestamp according to passed variables
* @var integer
*/
public $current_date = 0;
/**
* month number based on current_date
* @var integer
*/
public $int_month = null;
/**
示例5: import
public static function import()
{
$source_http = PHPWS_SOURCE_HTTP;
$script = "<script src='{$source_http}mod/rss/javascript/feed.js'></script>";
javascript('jquery');
\Layout::addJSHeader($script);
PHPWS_Core::requireConfig('rss');
if (!ini_get('allow_url_fopen')) {
$tpl['TITLE'] = dgettext('rss', 'Sorry');
$tpl['CONTENT'] = dgettext('rss', 'You must enable allow_url_fopen in your php.ini file.');
return $tpl;
}
PHPWS_Core::initCoreClass('DBPager.php');
PHPWS_Core::initModClass('rss', 'Feed.php');
$content = NULL;
$template['ADD_LINK'] = '<button class="btn btn-success edit-feed"><i></i> Add Feed</button>';
/*
$vars['address'] = 'index.php?module=rss&command=add_feed';
$vars['label'] = dgettext('rss', 'Add feed');
$vars['width'] = '450';
$vars['height'] = '350';
$template['ADD_LINK'] = javascript('open_window', $vars);
*
*/
$template['TITLE_LABEL'] = dgettext('rss', 'Title');
$template['ADDRESS_LABEL'] = dgettext('rss', 'Address');
$template['DISPLAY_LABEL'] = dgettext('rss', 'Display?');
$template['ACTION_LABEL'] = dgettext('rss', 'Action');
$template['REFRESH_TIME_LABEL'] = dgettext('rss', 'Refresh feed');
$modal = new \Modal('rss-modal');
$modal->addButton('<button class="btn btn-primary" id="save-feed"><i class="fa fa-save"></i> Save</button>');
$modal_content = RSS_Admin::editFeed();
$modal->setContent($modal_content);
$modal->setTitle('Edit feed');
$modal->setWidthPixel('400');
$template['MODAL'] = $modal->get();
$pager = new DBPager('rss_feeds', 'RSS_Feed');
$pager->setModule('rss');
$pager->setTemplate('admin_feeds.tpl');
$pager->addPageTags($template);
$pager->addRowTags('pagerTags');
$content = $pager->get();
$tpl['TITLE'] = dgettext('rss', 'Import RSS Feeds');
$tpl['CONTENT'] = $content;
if (!defined('ALLOW_CACHE_LITE') || !ALLOW_CACHE_LITE) {
$tpl['MESSAGE'] = dgettext('rss', 'Please enable Cache Lite in your config/core/config.php file.');
}
return $tpl;
}
示例6: view
public function view($level = '1', $admin = false)
{
\PHPWS_Core::requireConfig('menu');
static $current_parent = array();
$current_link = false;
$current_key = Key::getCurrent();
if (!empty($current_key)) {
if ($this->childIsCurrent($current_key)) {
$current_parent[] = $this->id;
}
if (!$current_key->isDummy() && $current_key->id == $this->key_id || $current_key->url == $this->url) {
$current_link = true;
$current_parent[] = $this->id;
$template['CURRENT_LINK'] = MENU_CURRENT_LINK_STYLE;
$template['ACTIVE'] = 'active';
// booststrap theme
}
}
if (!isset($template['CURRENT_LINK']) && $this->isCurrentUrl()) {
$current_link = true;
$current_parent[] = $this->id;
$template['CURRENT_LINK'] = MENU_CURRENT_LINK_STYLE;
$template['ACTIVE'] = 'active';
// booststrap theme
}
if ($this->childIsCurrentUrl()) {
$current_parent[] = $this->id;
}
if ($this->_menu->_show_all || $current_link || $this->parent == 0 || in_array($this->parent, $current_parent)) {
$link = $this->getAnchorTag($admin);
$template['LINK'] = $link;
$template['LINK_URL'] = $this->url;
$template['LINK_DROPDOWN'] = 'dropdown';
// Dummy tag to make dropdowns work
$template['LINK_TEXT'] = $this->title;
if (!empty($this->_children)) {
foreach ($this->_children as $kid) {
$kid->_menu =& $this->_menu;
if ($kid_link = $kid->view($level + 1, $admin)) {
$sublinks[] = $kid_link;
}
}
if (!empty($sublinks)) {
$template['SUBLINK'] = implode("\n", $sublinks);
}
$template['PARENT_ID'] = sprintf('menu-parent-%s', $this->id);
}
$template['LEVEL'] = $level;
$template['ID'] = $this->id;
$tpl_file = 'menu_layout/' . $this->_menu->template . '/link.tpl';
return PHPWS_Template::process($template, 'menu', $tpl_file);
} else {
return NULL;
}
}
示例7: __construct
<?php
/**
* @version $Id$
* @author Matthew McNaney <mcnaney at gmail dot com>
*/
PHPWS_Core::requireConfig('filecabinet');
PHPWS_Core::initModClass('filecabinet', 'File_Common.php');
define('GENERIC_VIDEO_ICON', PHPWS_SOURCE_HTTP . 'mod/filecabinet/img/video_generic.jpg');
define('GENERIC_AUDIO_ICON', PHPWS_SOURCE_HTTP . 'mod/filecabinet/img/audio.png');
class PHPWS_Multimedia extends File_Common
{
public $width = 0;
public $height = 0;
public $thumbnail = null;
/**
* In seconds
*/
public $duration = 0;
public $embedded = 0;
public $_classtype = 'multimedia';
public function __construct($id = 0)
{
$this->loadAllowedTypes();
$this->setMaxSize(PHPWS_Settings::get('filecabinet', 'max_multimedia_size'));
if (empty($id)) {
return;
}
$this->id = (int) $id;
$result = $this->init();
if (PHPWS_Error::isError($result)) {
示例8:
<?php
/**
* Initializes the menu class
*
* @author Matthew McNaney <mcnaney at gmail dot com
* @version $Id$
*/
PHPWS_Core::requireConfig('menu', 'config.php');
PHPWS_Core::initModClass('menu', 'Menu.php');
示例9: adminMenu
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @version $Id$
* @author Verdon Vaillancourt <verdonv at gmail dot com>
*/
PHPWS_Core::requireConfig('whatsnew');
class Whatsnew
{
var $forms = null;
var $panel = null;
var $title = null;
var $message = null;
var $content = null;
function adminMenu()
{
if (!Current_User::allow('whatsnew')) {
Current_User::disallow();
}
$this->loadPanel();
$javascript = false;
$this->loadMessage();
示例10: array
<?php
/**
* @version $Id$
* @author Matthew McNaney <mcnaney at gmail dot com>
*/
if (!defined('PHPWS_SOURCE_DIR')) {
include '../../core/conf/404.html';
exit;
}
PHPWS_Core::requireConfig('boost');
if (DEITY_ACCESS_ONLY && !Current_User::isDeity()) {
Current_User::disallow();
}
if (!Current_User::authorized('boost')) {
Current_User::disallow();
}
if (!isset($_REQUEST['action'])) {
PHPWS_Core::errorPage(404);
}
$js = false;
$content = array();
PHPWS_Core::initModClass('boost', 'Form.php');
PHPWS_Core::initModClass('controlpanel', 'Panel.php');
PHPWS_Core::initModClass('boost', 'Action.php');
$boostPanel = new PHPWS_Panel('boost');
$boostPanel->enableSecure();
Boost_Form::setTabs($boostPanel);
$vars = array('action' => 'admin', 'tab' => $boostPanel->getCurrentTab());
$backToBoost = PHPWS_Text::secureLink(dgettext('boost', 'Return to Boost'), 'boost', $vars);
switch ($_REQUEST['action']) {
示例11: main
<?php
/**
* User instructions
*
* @author Matthew McNaney <mcnaney at gmail dot com>
* @version $Id$
*/
PHPWS_Core::requireConfig('search');
class Search_User
{
public static function main()
{
if (!isset($_GET['user'])) {
PHPWS_Core::errorPage('404');
}
$command = $_GET['user'];
switch ($command) {
case 'search':
Search_User::searchPost();
break;
default:
PHPWS_Core::errorPage('404');
break;
}
}
public static function searchBox()
{
if (SEARCH_DEFAULT) {
$onclick = sprintf('onclick="if(this.value == \'%s\')this.value = \'\';"', SEARCH_DEFAULT);
}
示例12:
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Base class with functionality shared by Property and roommate
* @version $Id$
* @author Matthew McNaney <mcnaney at gmail dot com>
* @package
* @license http://opensource.org/licenses/gpl-3.0.html
*/
\PHPWS_Core::requireConfig('properties', 'defines.php');
abstract class Room_Base
{
public $id;
public $active = true;
public $airconditioning = 0;
/**
* Near appalcart
* @var boolean
*/
public $appalcart = 0;
public $clubhouse = 0;
public $cut_off_date = 0;
/**
* distance from campus figured in increments with lower bound
* determining amount
示例13: define
* Controls the text parsing and profanity controls for phpWebSite
* Also contains extra HTML utilities
*
* See core/conf/text_settings.php for configuration options
*
* @version $Id$
* @author Matthew McNaney <mcnaney at gmail dot com>
* @author Adam Morton
* @author Steven Levin
* @author Don Seiler <don@NOSPAM.seiler.us>
* @package Core
*/
if (!defined('UTF8_MODE')) {
define('UTF8_MODE', false);
}
PHPWS_Core::requireConfig('core', 'text_settings.php');
PHPWS_Core::initCoreClass('Link.php');
if (!defined('PHPWS_HOME_HTTP')) {
define('PHPWS_HOME_HTTP', './');
}
if (!defined('ENCODE_PARSED_TEXT')) {
define('ENCODE_PARSED_TEXT', true);
}
if (!defined('USE_BREAKER')) {
define('USE_BREAKER', true);
}
if (!defined('ALLOW_SCRIPT_TAGS')) {
define('ALLOW_SCRIPT_TAGS', false);
}
/**
* Changing this to FALSE will _ALLOW SCRIPT TAGS_!
示例14: define
<?php
/**
* Class containing all user information
*
* @author Matthew McNaney <mcnaney at gmail dot com>
* @version $Id$
*/
if (!defined('USERS_AUTH_PATH')) {
define('USERS_AUTH_PATH', PHPWS_SOURCE_DIR . 'mod/users/scripts/');
}
PHPWS_Core::initModClass('users', 'Permission.php');
PHPWS_Core::initModClass('users', 'Authorization.php');
PHPWS_Core::requireConfig('users');
require_once PHPWS_SOURCE_DIR . 'mod/users/inc/errorDefines.php';
if (!defined('ALLOWED_USERNAME_CHARACTERS')) {
define('ALLOWED_USERNAME_CHARACTERS' . '\\w');
}
class PHPWS_User
{
public $id = 0;
public $username = null;
public $deity = false;
public $active = true;
// id of authorizing file for user
public $authorize = 0;
public $last_logged = 0;
public $log_count = 0;
public $created = 0;
public $updated = 0;
// if true, they have been approved to log in
示例15: add
<?php
/**
* Simple class to add a module's administrator commands to a box
*
* @author Matthew McNaney <mcnaney at gmail dot com>
* @version $Id$
*/
PHPWS_Core::requireConfig('miniadmin');
if (!defined('MINIADMIN_TEMPLATE')) {
define('MINIADMIN_TEMPLATE', 'mini_admin.html');
}
class MiniAdmin
{
public static function add($module, $links)
{
if (is_array($links)) {
foreach ($links as $link) {
MiniAdmin::add($module, $link);
}
return true;
}
$GLOBALS['MiniAdmin'][$module]['links'][] = $links;
return true;
}
public static function get()
{
if (!\Current_User::isLogged()) {
return;
}
$modlist = PHPWS_Core::getModuleNames();