本文整理汇总了PHP中Backend类的典型用法代码示例。如果您正苦于以下问题:PHP Backend类的具体用法?PHP Backend怎么用?PHP Backend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Backend类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testCanBeEnabled
/**
* @dataProvider canBeEnabledProvider
*/
public function testCanBeEnabled($boolean)
{
$contacts = $this->getMock('\\OCP\\Contacts\\IManager');
$contacts->expects($this->any())->method('isEnabled')->will($this->returnValue($boolean));
$backend = new Backend($contacts);
$this->assertSame($boolean, $backend->canBeEnabled());
}
开发者ID:amin-hedayati,项目名称:calendar-rework,代码行数:10,代码来源:backendTest.php
示例2: uploadImageItem
public function uploadImageItem()
{
if ($img = $this->images_model->checkImgUpload()) {
$this->crud_model->update($this->input->post('type'), ['id' => $this->input->post('id'), 'image' => $img]);
echo Backend::tplElement('images/item', ['item' => $this->crud_model->select($this->input->post('type'), ['id' => $this->input->post('id')], 'row'), 'table' => $this->input->post('type')]);
}
}
开发者ID:alexber127,项目名称:StCms-v3.0,代码行数:7,代码来源:Upload.php
示例3: run
/**
* Generate the module
*
* @return string
*/
public function run()
{
/** @var \BackendTemplate|object $objTemplate */
$objTemplate = new \BackendTemplate('be_live_update');
$objTemplate->updateClass = 'tl_confirm';
$objTemplate->updateHeadline = $GLOBALS['TL_LANG']['tl_maintenance']['liveUpdate'];
$objTemplate->isActive = $this->isActive();
$strMessage = ' <a href="contao/changelog.php" onclick="Backend.openModalIframe({\'width\':860,\'title\':\'CHANGELOG\',\'url\':this.href});return false" title="' . specialchars($GLOBALS['TL_LANG']['tl_maintenance']['changelog']) . '"><img src="' . TL_FILES_URL . 'system/themes/' . \Backend::getTheme() . '/images/changelog.gif" width="14" height="14" alt="" style="vertical-align:text-bottom;padding-left:3px"></a>';
// Newer version available
if (\Config::get('latestVersion') && version_compare(VERSION . '.' . BUILD, \Config::get('latestVersion'), '<')) {
$objTemplate->updateClass = 'tl_info';
$objTemplate->updateMessage = sprintf($GLOBALS['TL_LANG']['tl_maintenance']['newVersion'], \Config::get('latestVersion')) . $strMessage;
} else {
$objTemplate->updateClass = 'tl_confirm';
$objTemplate->updateMessage = sprintf($GLOBALS['TL_LANG']['tl_maintenance']['upToDate'], VERSION . '.' . BUILD) . $strMessage;
}
// Automatically switch to SSL
if (\Environment::get('ssl')) {
\Config::set('liveUpdateBase', str_replace('http://', 'https://', \Config::get('liveUpdateBase')));
}
$objTemplate->uid = \Config::get('liveUpdateId');
$objTemplate->updateServer = \Config::get('liveUpdateBase') . 'index.php';
// Run the update
if (\Input::get('token') != '') {
$this->runLiveUpdate($objTemplate);
}
$objTemplate->version = VERSION . '.' . BUILD;
$objTemplate->liveUpdateId = $GLOBALS['TL_LANG']['tl_maintenance']['liveUpdateId'];
$objTemplate->runLiveUpdate = specialchars($GLOBALS['TL_LANG']['tl_maintenance']['runLiveUpdate']);
$objTemplate->referer = base64_encode(\Environment::get('base') . \Environment::get('request') . '|' . \Environment::get('server'));
$objTemplate->updateHelp = sprintf($GLOBALS['TL_LANG']['tl_maintenance']['updateHelp'], '<a href="http://luid.inetrobots.com" target="_blank">Live Update ID</a>');
$objTemplate->phar = file_exists(TL_ROOT . '/contao/update.phar.php');
$objTemplate->toLiveUpdate = $GLOBALS['TL_LANG']['tl_maintenance']['toLiveUpdate'];
return $objTemplate->parse();
}
开发者ID:bytehead,项目名称:contao-core,代码行数:40,代码来源:LiveUpdate.php
示例4: generateRendererButton
/**
* Generate the metamodels renderer button.
*
* @param array $row Current row.
* @param string $href The button href.
* @param string $label The button label.
* @param string $title The button title.
* @param string $icon The button icon.
* @param string $attributes Optional attributes.
*
* @return string
*/
public function generateRendererButton($row, $href, $label, $title, $icon, $attributes)
{
if (empty($this->layers[$row['type']]['metamodels'])) {
return '';
}
return sprintf('<a href="%s" title="%s">%s</a> ', \Backend::addToUrl($href . '&id=' . $row['id']), $title, \Image::getHtml($icon, $label, $attributes));
}
开发者ID:kikmedia,项目名称:contao-leaflet-metamodels,代码行数:19,代码来源:Layer.php
示例5: Instance
public static function Instance()
{
if (self::$instance == null) {
self::$instance = new Backend();
}
return self::$instance;
}
开发者ID:vortex52,项目名称:chat,代码行数:7,代码来源:backend.php
示例6: html_list
public function html_list($document)
{
Backend::add('Sub Title', $document->getMeta('name'));
Backend::add('TabLinks', $this->getTabLinks(Controller::$action));
Backend::add('Object', $document);
Backend::addContent(Render::renderFile('document_list.tpl.php'));
}
开发者ID:jrgns,项目名称:backend-php,代码行数:7,代码来源:Document.obj.php
示例7: process
/**
* Process stored event
*/
function process()
{
list($group_id, $user_id) = $this->getParametersAsArray();
if ($project = $this->getProject($group_id)) {
if ($user_id == 0) {
return $this->setErrorBadParam();
}
// CVS writers
if ($project->usesCVS()) {
if (!Backend::instance('CVS')->updateCVSwriters($group_id)) {
$this->error("Could not update CVS writers for group {$group_id}");
return false;
}
}
// SVN access file
if ($project->usesSVN()) {
if (!Backend::instance('SVN')->updateSVNAccess($group_id)) {
$this->error("Could not update SVN access file ({$group_id})");
return false;
}
}
// Need to update system group cache
Backend::instance('System')->setNeedRefreshGroupCache();
$this->done();
return true;
}
return false;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:31,代码来源:SystemEvent_MEMBERSHIP_DELETE.class.php
示例8: html_tweet
public function html_tweet($result)
{
if ($result) {
Backend::addSuccess('Tweeted!');
Backend::addContent(var_export($result, true));
}
}
开发者ID:jrgns,项目名称:backend-php,代码行数:7,代码来源:Twitter.obj.php
示例9: __construct
public function __construct()
{
parent::__construct();
$this->import('BackendUser', 'User');
$this->loadLanguageFile('tl_subscribe_plus');
$this->loadDataContainer('tl_subscribe_plus');
}
开发者ID:heimrichhannot,项目名称:contao-newsletter_plus,代码行数:7,代码来源:tl_newsletter_channel.php
示例10: createUser
/**
* Perform user creation on system
*
* @param PFUser $user
*
* @return Boolean
*/
private function createUser(PFUser $user)
{
Backend::instance('Aliases')->setNeedUpdateMailAliases();
$system_backend = Backend::instance('System');
$system_backend->flushNscdAndFsCache();
return $system_backend->createUserHome($user);
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:14,代码来源:SystemEvent_USER_CREATE.class.php
示例11: __construct
public function __construct()
{
parent::__construct();
$this->loadLanguageFile("tl_settings");
$this->import('BackendUser', 'User');
$this->import('Environment');
}
开发者ID:rsclg,项目名称:RscMemberSubmissionPostProcessor,代码行数:7,代码来源:RscMemberSubmissionPostProcessor.php
示例12: tearDown
public function tearDown() {
unlink($GLOBALS['alias_file']);
unset($GLOBALS['alias_file']);
//clear the cache between each tests
Backend::clearInstances();
EventManager::clearInstance();
}
开发者ID:rinodung,项目名称:tuleap,代码行数:7,代码来源:BackendAliasesTest.php
示例13: action_check
public function action_check()
{
$roles = GateKeeper::getRoles();
if (!$roles || !count($roles)) {
if (Controller::$debug) {
Backend::addNotice('No roles setup, addings some');
}
$roles = $this->getDefaultRoles();
if ($roles) {
foreach ($roles as $role) {
GateKeeper::assign($role['role'], $role['access_type'], $role['access_id']);
if (Controller::$debug) {
Backend::addSuccess('Added role ' . $role['role']);
}
}
}
$permits = $this->getDefaultPermissions();
if ($permits) {
foreach ($permits as $permit) {
GateKeeper::permit($permit['role'], $permit['control'], $permit['action'], $permit['subject'], $permit['subject_id']);
if (Controller::$debug) {
Backend::addSuccess('Added permission to ' . $role['action'] . ' to ' . $permit['role']);
}
}
}
} else {
if (Controller::$debug) {
var_dump($roles);
}
}
}
开发者ID:jrgns,项目名称:backend-php,代码行数:31,代码来源:System.obj.php
示例14: action_test
public function action_test()
{
/*$lock = BackendLock::get('testing', BackendLock::LOCK_CUSTOM);
if (!$lock) {
Backend::addError('Could not aquire lock');
} else {
Backend::addSuccess('Testing is ' . ($lock->check() ? 'Available' : 'Not Available'));
}
$lock = BackendLock::release('testing');
Backend::addSuccess('Testing is ' . ($lock->check() ? 'Available' : 'Not Available'));
if ($lock = BackendLock::get('testing_expiry', BackendLock::LOCK_CUSTOM, '2010-01-01')) {
Backend::addSuccess('Testing Expiry is ' . ($lock->check() ? 'Available' : 'Not Available'));
}
if ($lock = BackendLock::get('testing_type', 5)) {
Backend::addSuccess('Testing Type is ' . ($lock->check() ? 'Available' : 'Not Available'));
}*/
if ($lock = BackendLock::get('testing_system', BackendLock::LOCK_SYSTEM)) {
Backend::addSuccess('Testing Type is ' . ($lock->check() ? 'Available' : 'Not Available'));
} else {
Backend::addSuccess('Should not get System lock (no expiry or password)');
}
if ($lock = BackendLock::get('testing_system', BackendLock::LOCK_SYSTEM, 'now + 1 minutes', 'Abc123')) {
Backend::addSuccess('Testing Type is ' . ($lock->check() ? 'Available' : 'Not Available'));
} else {
Backend::addError('Could not get System lock');
}
return false;
}
开发者ID:jrgns,项目名称:backend-php,代码行数:28,代码来源:BackendLock.obj.php
示例15: run
/**
* Run the controller and parse the login template
*/
public function run()
{
$this->Template = new BackendTemplate('be_login');
// Show a cookie warning
if (Input::get('referer', true) != '' && empty($_COOKIE)) {
$this->Template->noCookies = $GLOBALS['TL_LANG']['MSC']['noCookies'];
}
$strHeadline = sprintf($GLOBALS['TL_LANG']['MSC']['loginTo'], Config::get('websiteTitle'));
$this->Template->theme = Backend::getTheme();
$this->Template->messages = Message::generate();
$this->Template->base = Environment::get('base');
$this->Template->language = $GLOBALS['TL_LANGUAGE'];
$this->Template->languages = System::getLanguages(true);
$this->Template->title = specialchars($strHeadline);
$this->Template->charset = Config::get('characterSet');
$this->Template->action = ampersand(Environment::get('request'));
$this->Template->userLanguage = $GLOBALS['TL_LANG']['tl_user']['language'][0];
$this->Template->headline = $strHeadline;
$this->Template->curLanguage = Input::post('language') ?: str_replace('-', '_', $GLOBALS['TL_LANGUAGE']);
$this->Template->curUsername = Input::post('username') ?: '';
$this->Template->uClass = $_POST && empty($_POST['username']) ? ' class="login_error"' : '';
$this->Template->pClass = $_POST && empty($_POST['password']) ? ' class="login_error"' : '';
$this->Template->loginButton = specialchars($GLOBALS['TL_LANG']['MSC']['loginBT']);
$this->Template->username = $GLOBALS['TL_LANG']['tl_user']['username'][0];
$this->Template->password = $GLOBALS['TL_LANG']['MSC']['password'][0];
$this->Template->feLink = $GLOBALS['TL_LANG']['MSC']['feLink'];
$this->Template->frontendFile = Environment::get('base');
$this->Template->disableCron = Config::get('disableCron');
$this->Template->ie6warning = sprintf($GLOBALS['TL_LANG']['ERR']['ie6warning'], '<a href="http://ie6countdown.com">', '</a>');
$this->Template->default = $GLOBALS['TL_LANG']['MSC']['default'];
$this->Template->output();
}
开发者ID:iCodr8,项目名称:core,代码行数:35,代码来源:index.php
示例16: __construct
/**
* Import the back end user object
*/
public function __construct()
{
parent::__construct();
$this->import('BackendUser', 'User');
$this->loadLanguageFile('orm_avisota_recipient');
$this->loadDataContainer('orm_avisota_recipient');
}
开发者ID:avisota,项目名称:contao-core,代码行数:10,代码来源:tl_avisota_recipient_export.php
示例17: editTemplate
public function editTemplate($v)
{
if (isset(Pages_model::$types[$v])) {
$this->admin['type'] = ['type' => $v, 'value' => Pages_model::$types[$v]];
Backend::tpl('templates/templateedit');
}
}
开发者ID:alexber127,项目名称:StCms-v2.0,代码行数:7,代码来源:Admin_ajax.php
示例18: __construct
/**
* Initialize the controller
*
* 1. Import the user
* 2. Call the parent constructor
* 3. Authenticate the user
* 4. Load the language files
* DO NOT CHANGE THIS ORDER!
*/
public function __construct()
{
$this->import('BackendUser', 'User');
parent::__construct();
$this->User->authenticate();
$this->loadLanguageFile('default');
}
开发者ID:rikaix,项目名称:core,代码行数:16,代码来源:file.php
示例19: enable
public static function enable()
{
Backend::addScript(SITE_LINK . '/js/jquery.js');
Backend::addScript(SITE_LINK . '/js/wmd.component.js');
Backend::addScript(SITE_LINK . '/js/wmd/wmd.js');
Backend::addStyle(SITE_LINK . '/css/wmd.css');
}
开发者ID:jrgns,项目名称:backend-php,代码行数:7,代码来源:WMD.obj.php
示例20: __construct
public function __construct()
{
$this->import('BackendUser', 'User');
parent::__construct();
$this->import('AvisotaBase', 'Base');
$this->import('AvisotaNewsletterContent', 'Content');
$this->import('AvisotaStatic', 'Static');
$this->import('Database');
// force all URLs absolute
$GLOBALS['TL_CONFIG']['forceAbsoluteDomainLink'] = true;
// load default translations
$this->loadLanguageFile('default');
// HOTFIX Remove isotope frontend hook
if (isset($GLOBALS['TL_HOOKS']['parseTemplate']) && is_array($GLOBALS['TL_HOOKS']['parseTemplate'])) {
foreach ($GLOBALS['TL_HOOKS']['parseTemplate'] as $k => $v) {
if ($v[0] == 'IsotopeFrontend') {
unset($GLOBALS['TL_HOOKS']['parseTemplate'][$k]);
}
}
}
// HOTFIX Remove catalog frontend hook
if (isset($GLOBALS['TL_HOOKS']['parseFrontendTemplate']) && is_array($GLOBALS['TL_HOOKS']['parseFrontendTemplate'])) {
foreach ($GLOBALS['TL_HOOKS']['parseFrontendTemplate'] as $k => $v) {
if ($v[0] == 'CatalogExt') {
unset($GLOBALS['TL_HOOKS']['parseFrontendTemplate'][$k]);
}
}
}
}
开发者ID:Ainschy,项目名称:contao-core,代码行数:29,代码来源:AvisotaNewsletterTransport.php
注:本文中的Backend类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论