本文整理汇总了PHP中Backend类的典型用法代码示例。如果您正苦于以下问题:PHP Backend类的具体用法?PHP Backend怎么用?PHP Backend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Backend类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
示例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')]);
}
}
示例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();
}
示例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));
}
示例5: Instance
public static function Instance()
{
if (self::$instance == null) {
self::$instance = new Backend();
}
return self::$instance;
}
示例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'));
}
示例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;
}
示例8: html_tweet
public function html_tweet($result)
{
if ($result) {
Backend::addSuccess('Tweeted!');
Backend::addContent(var_export($result, true));
}
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->import('BackendUser', 'User');
$this->loadLanguageFile('tl_subscribe_plus');
$this->loadDataContainer('tl_subscribe_plus');
}
示例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);
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->loadLanguageFile("tl_settings");
$this->import('BackendUser', 'User');
$this->import('Environment');
}
示例12: tearDown
public function tearDown() {
unlink($GLOBALS['alias_file']);
unset($GLOBALS['alias_file']);
//clear the cache between each tests
Backend::clearInstances();
EventManager::clearInstance();
}
示例13: __call
public function __call($method, $args)
{
$id = md5($method . serialize($args) . serialize(get_object_vars($this->object)));
if (($value = $this->backend->get($id)) === null) {
$value = call_user_func_array(array($this->object, $method), $args);
$this->backend->add($id, $value);
}
return $value;
}
示例14: createFolderWithRightAccessRights
/**
* @throws Docman_FolderNotCreatedException
*/
private function createFolderWithRightAccessRights($folder_path, $project_unix_name)
{
if (!mkdir($folder_path)) {
throw new Docman_FolderNotCreatedException("Folder {$folder_path} not created");
}
$user = ForgeConfig::get('sys_http_user');
$this->backend->changeOwnerGroupMode($folder_path, $user, $user, 0700);
$this->logger->info("Docman root folder for project {$project_unix_name} created");
}
示例15: init
public function init()
{
parent::init();
parent::auth();
$this->_db = Yii::app()->db;
exit('暂不开启,后续待开发');
}