本文整理汇总了PHP中thebuggenie\core\framework\Settings类的典型用法代码示例。如果您正苦于以下问题:PHP Settings类的具体用法?PHP Settings怎么用?PHP Settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Settings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearUserScopes
public function clearUserScopes($user_id)
{
$crit = $this->getCriteria();
$crit->addWhere(self::SCOPE, \thebuggenie\core\framework\Settings::getDefaultScopeID(), Criteria::DB_NOT_EQUALS);
$crit->addWhere(self::USER_ID, $user_id);
$this->doDelete($crit);
}
示例2: runResolve
public function runResolve(framework\Request $request)
{
$theme = isset($request['theme_name']) ? $request['theme_name'] : framework\Settings::getThemeName();
if ($request->hasParameter('css')) {
$this->getResponse()->setContentType('text/css');
if (!$request->hasParameter('theme_name')) {
$basepath = THEBUGGENIE_PATH . 'public' . DS . 'css';
$asset = THEBUGGENIE_PATH . 'public' . DS . 'css' . DS . $request->getParameter('css');
} else {
$basepath = THEBUGGENIE_PATH . 'themes';
$asset = THEBUGGENIE_PATH . 'themes' . DS . $theme . DS . 'css' . DS . $request->getParameter('css');
}
} elseif ($request->hasParameter('js')) {
$this->getResponse()->setContentType('text/javascript');
if ($request->hasParameter('theme_name')) {
$basepath = THEBUGGENIE_PATH . 'themes';
$asset = THEBUGGENIE_PATH . 'themes' . DS . $theme . DS . 'js' . DS . $request->getParameter('js');
} elseif ($request->hasParameter('module_name') && framework\Context::isModuleLoaded($request['module_name'])) {
$module_path = framework\Context::isInternalModule($request['module_name']) ? THEBUGGENIE_INTERNAL_MODULES_PATH : THEBUGGENIE_MODULES_PATH;
$basepath = $module_path . $request['module_name'] . DS . 'public' . DS . 'js';
$asset = $module_path . $request['module_name'] . DS . 'public' . DS . 'js' . DS . $request->getParameter('js');
} else {
$basepath = THEBUGGENIE_PATH . 'public' . DS . 'js';
$asset = THEBUGGENIE_PATH . 'public' . DS . 'js' . DS . $request->getParameter('js');
}
} else {
throw new \Exception('The expected theme Asset type is not supported.');
}
$fileAsset = new AssetCollection(array(new FileAsset($asset, array(), $basepath)));
$fileAsset->load();
// Do not decorate the asset with the theme's header/footer
$this->getResponse()->setDecoration(framework\Response::DECORATE_NONE);
return $this->renderText($fileAsset->dump());
}
示例3: do_execute
public function do_execute()
{
/* Prepare variables */
try {
$project_id = $this->getProvidedArgument('projectid');
$project_row = \thebuggenie\core\entities\tables\Projects::getTable()->getById($project_id, false);
\thebuggenie\core\framework\Context::setScope(new \thebuggenie\core\entities\Scope($project_row[\thebuggenie\core\entities\tables\Projects::SCOPE]));
$project = new \thebuggenie\core\entities\Project($project_id, $project_row);
} catch (\Exception $e) {
$this->cliEcho("The project with the ID " . $this->getProvidedArgument('projectid') . " does not exist\n", 'red', 'bold');
exit;
}
$author = $this->getProvidedArgument('author');
$new_rev = $this->getProvidedArgument('revno');
$commit_msg = $this->getProvidedArgument('log');
$changed = $this->getProvidedArgument('changed');
$old_rev = $this->getProvidedArgument('oldrev', null);
$date = $this->getProvidedArgument('date', null);
$branch = $this->getProvidedArgument('branch', null);
if (\thebuggenie\core\framework\Settings::get('access_method_' . $project->getKey()) == Vcs_integration::ACCESS_HTTP) {
$this->cliEcho("This project uses the HTTP access method, and so access via the CLI has been disabled\n", 'red', 'bold');
exit;
}
if ($old_rev === null && !ctype_digit($new_rev)) {
$this->cliEcho("Error: if only the new revision is specified, it must be a number so that old revision can be calculated from it (by substracting 1 from new revision number).");
} else {
if ($old_rev === null) {
$old_rev = $new_rev - 1;
}
}
$output = Vcs_integration::processCommit($project, $commit_msg, $old_rev, $new_rev, $date, $changed, $author, $branch);
$this->cliEcho($output);
}
示例4: loadFixtures
public function loadFixtures(\thebuggenie\core\entities\Scope $scope)
{
foreach (IssueTypes::getTable()->getAllIDsByScopeID($scope->getID()) as $issuetype_id) {
$crit = $this->getCriteria();
$crit->addInsert(self::SCOPE, $scope->getID());
$crit->addInsert(self::WORKFLOW_ID, \thebuggenie\core\framework\Settings::getCoreWorkflow()->getID());
$crit->addInsert(self::WORKFLOW_SCHEME_ID, \thebuggenie\core\framework\Settings::getCoreWorkflowScheme()->getID());
$crit->addInsert(self::ISSUETYPE_ID, $issuetype_id);
$this->doInsert($crit);
}
}
示例5: runLogout
/**
* Logs the user out
*
* @param \thebuggenie\core\framework\Request $request
*
* @return bool
*/
public function runLogout(framework\Request $request)
{
if ($this->getUser() instanceof entities\User) {
framework\Logging::log('Setting user logout state');
$this->getUser()->setOffline();
}
framework\Context::logout();
if ($request->isAjaxCall()) {
return $this->renderJSON(array('status' => 'logout ok', 'url' => framework\Context::getRouting()->generate(framework\Settings::getLogoutReturnRoute())));
}
$this->forward(framework\Context::getRouting()->generate(framework\Settings::getLogoutReturnRoute()));
}
示例6: testInstallMode
/**
* @covers \thebuggenie\core\framework\Context::isInstallmode
* @covers \thebuggenie\core\framework\Context::checkInstallMode
*/
public function testInstallMode()
{
$installed_file = THEBUGGENIE_PATH . 'installed';
if (file_exists($installed_file)) {
unlink($installed_file);
}
\thebuggenie\core\framework\Context::checkInstallMode();
$this->assertTrue(\thebuggenie\core\framework\Context::isInstallmode());
file_put_contents($installed_file, \thebuggenie\core\framework\Settings::getMajorVer() . "." . \thebuggenie\core\framework\Settings::getMinorVer() . "." . \thebuggenie\core\framework\Settings::getRevision() . ", installed today");
\thebuggenie\core\framework\Context::checkInstallMode();
$this->assertFalse(\thebuggenie\core\framework\Context::isInstallmode());
}
示例7: _install
protected function _install($scope)
{
if ($scope == framework\Settings::getDefaultScopeID()) {
$mobile_css_path = THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DS . 'css' . DS . 'mobile.css';
if (!is_writable(pathinfo($mobile_css_path, PATHINFO_DIRNAME))) {
throw new framework\exceptions\ConfigurationException("Cannot save the file {$mobile_css_path}", framework\exceptions\ConfigurationException::PERMISSION_DENIED);
}
if (file_exists($mobile_css_path)) {
unlink($mobile_css_path);
}
symlink(THEBUGGENIE_MODULES_PATH . 'mobile' . DS . 'css' . DS . 'mobile.css', $mobile_css_path);
}
}
示例8: do_execute
public function do_execute()
{
$hostname = $this->getProvidedArgument('hostname');
$this->cliEcho('Checking scope availability ...');
if (tables\ScopeHostnames::getTable()->getScopeIDForHostname($hostname) === null) {
$this->cliEcho("available!\n");
$this->cliEcho("Creating scope ...");
$scope = new entities\Scope();
$scope->addHostname($hostname);
$scope->setName($this->getProvidedArgument('shortname'));
$uploads_enabled = $this->getProvidedArgument('enable_uploads', 'yes') == 'yes';
$scope->setUploadsEnabled((bool) $uploads_enabled);
$scope->setMaxUploadLimit($this->getProvidedArgument('upload_limit', 0));
$scope->setMaxProjects($this->getProvidedArgument('projects', 0));
$scope->setMaxUsers($this->getProvidedArgument('users', 0));
$scope->setMaxTeams($this->getProvidedArgument('teams', 0));
$scope->setMaxWorkflowsLimit($this->getProvidedArgument('workflows', 0));
$scope->setEnabled();
$this->cliEcho(".");
$scope->save();
$this->cliEcho(".done!\n");
$admin_user = $this->getProvidedArgument('scope_admin');
if ($admin_user) {
$user = entities\User::getByUsername($admin_user);
if ($user instanceof entities\User) {
$this->cliEcho("Adding user {$admin_user} to scope\n");
$admin_group_id = (int) framework\Settings::get(framework\Settings::SETTING_ADMIN_GROUP, 'core', $scope->getID());
tables\UserScopes::getTable()->addUserToScope($user->getID(), $scope->getID(), $admin_group_id, true);
} else {
$this->cliEcho("Could not add user {$admin_user} to scope (username not found)\n");
}
}
if ($this->getProvidedArgument('remove_admin', 'no') == 'yes') {
$this->cliEcho("Removing administrator user from scope\n");
tables\UserScopes::getTable()->removeUserFromScope(1, $scope->getID());
}
foreach (framework\Context::getModules() as $module) {
$module_name = $module->getName();
if ($module_name == 'publish') {
continue;
}
if ($this->getProvidedArgument("install_module_{$module_name}", "no") == 'yes') {
$this->cliEcho("Installing module {$module_name}\n");
entities\Module::installModule($module_name, $scope);
}
}
} else {
$this->cliEcho("not available\n", 'red');
}
$this->cliEcho("\n");
}
示例9: do_execute
public function do_execute()
{
$this->cliEcho("\n");
$this->cliEcho("Revert authentication backend\n", 'white', 'bold');
$this->cliEcho("This command is useful if you've managed to lock yourself.\n");
$this->cliEcho("out due to an authentication backend change gone bad.\n\n");
if (\thebuggenie\core\framework\Settings::getAuthenticationBackend() == 'tbg' || \thebuggenie\core\framework\Settings::getAuthenticationBackend() == null) {
$this->cliEcho("You are currently using the default authentication backend.\n\n");
} else {
$this->cliEcho("Please type 'yes' if you want to revert to the default authentication backend: ");
$this->cliEcho("\n");
if ($this->getInput() == 'yes') {
\thebuggenie\core\framework\Settings::saveSetting(\thebuggenie\core\framework\Settings::SETTING_AUTH_BACKEND, 'tbg');
$this->cliEcho("Authentication backend reverted.\n\n");
} else {
$this->cliEcho("No changes made.\n\n");
}
}
}
示例10: componentLeftmenu
public function componentLeftmenu()
{
$config_sections = framework\Settings::getConfigSections(framework\Context::getI18n());
$breadcrumblinks = array();
foreach ($config_sections as $key => $sections) {
foreach ($sections as $section) {
if ($key == framework\Settings::CONFIGURATION_SECTION_MODULES) {
$url = is_array($section['route']) ? make_url($section['route'][0], $section['route'][1]) : make_url($section['route']);
$breadcrumblinks[] = array('url' => $url, 'title' => $section['description']);
} else {
$breadcrumblinks[] = array('url' => make_url($section['route']), 'title' => $section['description']);
}
}
}
$this->breadcrumblinks = $breadcrumblinks;
$this->config_sections = $config_sections;
if ($this->selected_section == framework\Settings::CONFIGURATION_SECTION_MODULES) {
if (framework\Context::getRouting()->getCurrentRouteName() == 'configure_modules') {
$this->selected_subsection = 'core';
} else {
$this->selected_subsection = framework\Context::getRequest()->getParameter('config_module');
}
}
}
示例11: setContentSyntax
public function setContentSyntax($syntax)
{
if (!is_numeric($syntax)) {
$syntax = framework\Settings::getSyntaxValue($syntax);
}
$this->_content_syntax = $syntax;
}
示例12: url
?>
openid_providers.small/openid.ico.png'); }
#regular-signin-button.persona-button span:after{ background-image: url('<?php
echo $webroot . 'iconsets/' . \thebuggenie\core\framework\Settings::getIconsetName() . '/';
?>
footer_logo.png'); }
#forgot_password_username { background-image: url('<?php
echo $webroot . 'iconsets/' . \thebuggenie\core\framework\Settings::getIconsetName() . '/';
?>
user_mono.png'); }
#planning_filter_title_input { background-image: url('<?php
echo $webroot . 'iconsets/' . \thebuggenie\core\framework\Settings::getIconsetName() . '/';
?>
icon-mono-search.png'); }
.login_popup .article h1 { background: url('<?php
echo $webroot . 'iconsets/' . \thebuggenie\core\framework\Settings::getIconsetName() . '/';
?>
logo_48.png') 0 0 no-repeat; }
table.results_normal th.sort_asc { background-image: url('<?php
echo $webroot;
?>
iconsets/oxygen/sort_down.png') !important; padding-left: 25px !important; }
table.results_normal th.sort_desc { background-image: url('<?php
echo $webroot;
?>
iconsets/oxygen/sort_up.png') !important; padding-left: 25px !important; }
.module .rating { background-image:url('<?php
echo $webroot;
?>
示例13: get_spaced_name
} else {
?>
<?php
if ($article->getArticleType() == \thebuggenie\modules\publish\entities\Article::TYPE_MANUAL) {
echo get_spaced_name($article->getManualName());
} else {
$namespaces = explode(':', $article_name);
if (count($namespaces) > 1 && $namespaces[0] == 'Category') {
array_shift($namespaces);
echo '<span class="faded_out blue">Category:</span>';
}
if (\thebuggenie\core\framework\Context::isProjectContext() && count($namespaces) > 1 && mb_strtolower($namespaces[0]) == \thebuggenie\core\framework\Context::getCurrentProject()->getKey()) {
array_shift($namespaces);
echo '<span>', \thebuggenie\core\framework\Context::getCurrentProject()->getName(), ':</span>';
}
echo \thebuggenie\core\framework\Settings::get('allow_camelcase_links', 'publish', \thebuggenie\core\framework\Context::getScope()->getID(), 0) ? get_spaced_name(implode(':', $namespaces)) : implode(':', $namespaces);
}
?>
<?php
}
?>
<?php
if ($article->getID() && $mode) {
switch ($mode) {
/* case 'edit':
?><span class="faded_out"><?php echo __('%article_name ~ Edit', array('%article_name' => '')); ?></span><?php
break; */
case 'history':
?>
<span class="faded_out"><?php
echo __('%article_name ~ History', array('%article_name' => ''));
示例14: array
<?php
\thebuggenie\core\framework\Context::loadLibrary('publish/publish');
?>
<div class="article syntax_<?php
echo \thebuggenie\core\framework\Settings::getSyntaxClass($article->getContentSyntax());
?>
">
<?php
if ($show_title) {
?>
<?php
include_component('publish/header', array('article_name' => $article->getName(), 'article' => $article, 'show_actions' => $show_actions, 'mode' => $mode, 'embedded' => $embedded));
?>
<?php
}
?>
<?php
if ($show_details && $show_article) {
?>
<div class="details">
<?php
if (isset($redirected_from)) {
?>
<div class="redirected_from">→ <?php
echo __('Redirected from %article_name', array('%article_name' => link_tag(make_url('publish_article_edit', array('article_name' => $redirected_from)), get_spaced_name($redirected_from))));
?>
</div>
<?php
}
?>
示例15: canUserSet
public function canUserSet(\thebuggenie\core\entities\User $user)
{
$retval = $user->hasPermission($this->getPermissionsKey(), $this->getID(), 'core');
$retval = $retval === null ? $user->hasPermission($this->getPermissionsKey(), 0, 'core') : $retval;
return $retval !== null ? $retval : \thebuggenie\core\framework\Settings::isPermissive();
}