本文整理汇总了PHP中Kurogo::getSiteSection方法的典型用法代码示例。如果您正苦于以下问题:PHP Kurogo::getSiteSection方法的具体用法?PHP Kurogo::getSiteSection怎么用?PHP Kurogo::getSiteSection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kurogo
的用法示例。
在下文中一共展示了Kurogo::getSiteSection方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($config = null)
{
if (!is_array($config) || empty($config)) {
$config = Kurogo::getSiteSection('database');
}
$this->init($config);
}
示例2: __construct
public function __construct($config = null)
{
if (!is_array($config) || empty($config)) {
$config = Kurogo::getSiteSection('database');
$config = array_merge($config, array_intersect_key($_SERVER, $config));
}
$this->init($config);
}
示例3: init
protected function init($args)
{
parent::init($args);
if (!isset($args['DB_TYPE'])) {
$args = array_merge(Kurogo::getSiteSection('database'), $args);
}
if (isset($args['SQL'])) {
$this->setSQL($args['SQL']);
}
if (isset($args['PARAMETERS']) && is_array($args['PARAMETERS'])) {
$this->setParameters($args['PARAMETERS']);
}
$this->connection = new db($args);
}
示例4: session
public function session()
{
$this->addPackage('Session');
if (!$this->session) {
$args = Kurogo::getSiteSection('authentication');
//default session class
$controllerClass = 'SessionFiles';
//maintain previous config compatibility
if (isset($args['AUTHENTICATION_USE_SESSION_DB']) && $args['AUTHENTICATION_USE_SESSION_DB']) {
$controllerClass = 'SessionDB';
}
if (isset($args['AUTHENTICATION_SESSION_CLASS'])) {
$controllerClass = $args['AUTHENTICATION_SESSION_CLASS'];
}
$this->session = Session::factory($controllerClass, $args);
}
return $this->session;
}
示例5: Exception
default:
throw new Exception("Invalid API request: '{$_SERVER['REQUEST_URI']}'", 1);
break;
}
/* log the api call */
PageViews::log_api($id, Kurogo::deviceClassifier()->getPlatform());
$module->executeCommand();
} else {
$id = $parts[0];
$page = 'index';
/* see if there's a redirect for this path */
if ($url_redirects = Kurogo::getSiteSection('urls')) {
if (array_key_exists($id, $url_redirects)) {
if (preg_match("#^http(s)?://#", $url_redirects[$id])) {
$url = $url_redirects[$id];
} else {
$parts[0] = $url_redirects[$id];
$url = URL_PREFIX . implode("/", $parts);
}
header("Location: " . $url);
exit;
}
}
// find the page part
if (isset($parts[1])) {
if (strlen($parts[1])) {
示例6: init
protected function init($args) {
parent::init($args);
$args = is_array($args) ? $args : array();
if (!isset($args['DB_TYPE'])) {
$args = array_merge(Kurogo::getSiteSection('database'), $args);
}
$this->connection = new db($args);
if (isset($args['SORTFIELDS']) && is_array($args['SORTFIELDS'])) {
$this->sortFields = $args['SORTFIELDS'];
}
$this->table = isset($args['DB_USER_TABLE']) ? $args['DB_USER_TABLE'] : 'users';
$this->fieldMap = array(
'userid'=>isset($args['DB_USERID_FIELD']) ? $args['DB_USERID_FIELD'] : 'userID',
'email'=>isset($args['DB_EMAIL_FIELD']) ? $args['DB_EMAIL_FIELD'] : 'email',
'firstname'=>isset($args['DB_FIRSTNAME_FIELD']) ? $args['DB_FIRSTNAME_FIELD'] : 'firstname',
'lastname'=>isset($args['DB_LASTNAME_FIELD']) ? $args['DB_LASTNAME_FIELD'] : 'lastname'
);
}
示例7: init
public function init($args)
{
parent::init($args);
$args = is_array($args) ? $args : array();
if (!isset($args['DB_TYPE'])) {
$args = array_merge(Kurogo::getSiteSection('database'), $args);
}
$this->connection = new db($args);
$this->tableMap = array('user' => 'users', 'group' => 'groups', 'groupmembers' => 'groupmembers');
$this->fieldMap = array('user_userid' => 'userID', 'user_password' => 'password', 'user_email' => 'email', 'user_firstname' => 'firstname', 'user_lastname' => 'lastname', 'user_fullname' => 'fullname', 'group_groupname' => 'group', 'group_gid' => 'gid', 'group_groupmember' => 'gid', 'groupmember_group' => 'gid', 'groupmember_user' => 'userID', 'groupmember_authority' => '');
foreach ($args as $arg => $value) {
if (preg_match("/^db_(user|group|groupmember)_(.*?)_field\$/", strtolower($arg), $bits)) {
$key = sprintf("%s_%s", $bits[1], $bits[2]);
if (isset($this->fieldMap[$key])) {
$this->fieldMap[$key] = $value;
}
} elseif (preg_match("/^db_(.*?)_table\$/", strtolower($arg), $bits)) {
$key = $bits[1];
if (isset($this->tableMap[$key])) {
$this->tableMap[$key] = $value;
}
} else {
switch ($arg) {
case 'DB_USER_PASSWORD_HASH':
if (preg_match("/^hmac_(.+)\$/", $value, $bits)) {
if (!isset($args['DB_USER_PASSWORD_KEY'])) {
throw new KurogoConfigurationException("HMAC hash requires DB_USER_PASSWORD_KEY");
}
$this->hmac = true;
$value = $bits[1];
}
if (!in_array($value, hash_algos())) {
throw new KurogoConfigurationException("Hashing algorithm {$value} not available");
}
$this->hashAlgo = $value;
break;
case 'DB_USER_PASSWORD_KEY':
$this->hashKey = $value;
break;
case 'DB_USER_PASSWORD_SALT':
case 'DB_USER_PASSWORD_SALT_BEFORE':
$this->hashSaltBefore = $value;
break;
case 'DB_USER_PASSWORD_SALT_AFTER':
$this->hashSaltAfter = $value;
break;
case 'DB_USER_PASSWORD_SALT_FIELD_BEFORE':
$this->hashSaltFieldBefore = $value;
break;
case 'DB_USER_PASSWORD_SALT_FIELD_AFTER':
$this->hashSaltFieldAfter = $value;
break;
case 'DB_GROUP_GROUPMEMBER_PROPERTY':
if (!in_array($value, array('group', 'gid'))) {
throw new KurogoConfigurationException("Invalid value for DB_GROUP_GROUPMEMBER_PROPERTY {$value}. Should be gid or group");
}
$this->fieldMap['group_groupmember'] = $value;
break;
}
}
}
}
示例8: loadPageConfig
private function loadPageConfig()
{
if (!isset($this->pageConfig)) {
Kurogo::log(LOG_DEBUG, "Loading page configuration for {$this->configModule} - {$this->page}", 'module');
$this->setPageTitle($this->moduleName);
// Load site configuration and help text
$this->assign('strings', Kurogo::getSiteSection('strings'));
// load module config file
$pageData = $this->getPageData();
if (!isset($pageData[$this->page])) {
throw new KurogoPageNotFoundException(Kurogo::getLocalizedString("ERROR_PAGE_NOT_FOUND", $this->page));
}
$pageConfig = $pageData[$this->page];
if (KurogoWebBridge::isNativeCall()) {
$this->hasWebBridgePageRefresh = self::argVal($pageConfig, 'nativePageRefresh', false);
$this->hasWebBridgeAutoRefresh = self::argVal($pageConfig, 'nativePageAutoRefresh', false);
}
if (KurogoWebBridge::isNativeCall() && self::argVal($pageConfig, 'nativePageTitle', '')) {
$this->pageTitle = $pageConfig['nativePageTitle'];
} else {
if (isset($pageConfig['pageTitle']) && strlen($pageConfig['pageTitle'])) {
$this->pageTitle = $pageConfig['pageTitle'];
}
}
if (KurogoWebBridge::isNativeCall() && self::argVal($pageConfig, 'nativeBreadcrumbTitle', '')) {
$this->breadcrumbTitle = $pageConfig['nativeBreadcrumbTitle'];
} else {
if (isset($pageConfig['breadcrumbTitle']) && strlen($pageConfig['breadcrumbTitle'])) {
$this->breadcrumbTitle = $pageConfig['breadcrumbTitle'];
} else {
$this->breadcrumbTitle = $this->pageTitle;
}
}
if (isset($pageConfig['breadcrumbLongTitle']) && strlen($pageConfig['breadcrumbLongTitle'])) {
$this->breadcrumbLongTitle = $pageConfig['breadcrumbLongTitle'];
} else {
$this->breadcrumbLongTitle = $this->pageTitle;
}
$this->pageConfig = $pageConfig;
}
// Ajax overrides for breadcrumb title and long title
if (isset($this->args[self::AJAX_BREADCRUMB_TITLE])) {
$this->breadcrumbTitle = $this->args[self::AJAX_BREADCRUMB_TITLE];
$this->breadcrumbLongTitle = $this->breadcrumbTitle;
}
if (isset($this->args[self::AJAX_BREADCRUMB_LONG_TITLE])) {
$this->breadcrumbLongTitle = $this->args[self::AJAX_BREADCRUMB_LONG_TITLE];
}
}
示例9: getSession
/**
* Returns the current login session
* @param string $type, the type of module to load (web/api)
*/
protected function getSession() {
if (!$this->session) {
$args = Kurogo::getSiteSection('authentication');
$args['DEBUG_MODE'] = Kurogo::getSiteVar('DATA_DEBUG');
$this->session = new Session($args);
}
return $this->session;
}
示例10: timezoneFilter
private static function timezoneFilter($tzid)
{
static $timezoneMap;
if (!$timezoneMap) {
$timezoneMap = Kurogo::getSiteSection('timezones');
}
return Kurogo::arrayVal($timezoneMap, $tzid, $tzid);
}