本文整理汇总了PHP中Variable::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Variable::set方法的具体用法?PHP Variable::set怎么用?PHP Variable::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Variable
的用法示例。
在下文中一共展示了Variable::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
public function install()
{
$ret = DB::CreateTable('user_password', "user_login_id I KEY, password C(256) NOTNULL, mail C(255) NOTNULL", array('constraints' => ', FOREIGN KEY (user_login_id) REFERENCES user_login(id)'));
if ($ret === false) {
print 'Invalid SQL query - user_password table install';
return false;
}
$ret = DB::CreateTable('user_autologin', "user_login_id I NOTNULL, autologin_id C(32) NOTNULL, last_log T, description C(64)", array('constraints' => ', FOREIGN KEY (user_login_id) REFERENCES user_login(id)'));
if ($ret === false) {
print 'Invalid SQL query - user_autologin table install';
return false;
}
$ret = DB::CreateTable('user_login_ban', "failed_on I4, from_addr C(32)");
if ($ret === false) {
print 'Invalid SQL query - user_login_ban table install';
return false;
}
$ret = DB::CreateTable('user_reset_pass', "user_login_id I NOTNULL, hash_id C(32) NOTNULL, created_on T DEFTIMESTAMP", array('constraints' => ', FOREIGN KEY (user_login_id) REFERENCES user_login(id)'));
if ($ret === false) {
print 'Invalid SQL query - user_autologin table install';
return false;
}
Variable::set('host_ban_time', 300);
Variable::set('host_ban_nr_of_tries', 3);
Variable::set('host_ban_by_login', 0);
Base_ThemeCommon::install_default_theme(Base_User_LoginInstall::module_name());
return true;
}
示例2: install
public function install()
{
Base_ThemeCommon::install_default_theme($this->get_type());
Variable::set('error_mail', '');
$this->create_data_dir();
return true;
}
示例3: install
public function install()
{
$ret = true;
if ($ret) {
$ret = Variable::set('mail_from_addr', 'admin@example.com');
}
if ($ret) {
$ret = Variable::set('mail_from_name', 'Administrator');
}
if ($ret) {
$ret = Variable::set('mail_use_replyto', '');
}
if ($ret) {
$ret = Variable::set('mail_method', 'mail');
}
if ($ret) {
$ret = Variable::set('mail_user', '');
}
if ($ret) {
$ret = Variable::set('mail_password', '');
}
if ($ret) {
$ret = Variable::set('mail_host', 'smtp.example.com:25');
}
if ($ret) {
$ret = Variable::set('mail_security', '');
}
if ($ret) {
$ret = Variable::set('mail_auth', false);
}
Base_ThemeCommon::install_default_theme($this->get_type());
return $ret;
}
示例4: submit_admin
public function submit_admin($data)
{
Variable::set('default_theme', $data['theme']);
Base_ThemeCommon::create_cache();
Base_StatusBarCommon::message('Theme changed - reloading page');
eval_js('setTimeout(\'document.location=\\\'index.php\\\'\',\'3000\')');
return true;
}
示例5: install
public function install()
{
Variable::set('base_page_title', 'EPESI');
Variable::set('show_caption_in_title', '1');
Variable::set('show_module_indicator', '1');
Variable::set('logo_file', '');
Variable::set('login_logo_file', '');
Base_ThemeCommon::install_default_theme(Base_MainModuleIndicatorInstall::module_name());
$this->create_data_dir();
return true;
}
示例6: install
public function install()
{
$this->create_data_dir();
mkdir(DATA_DIR . '/Base_Theme/templates');
mkdir(DATA_DIR . '/Base_Theme/templates/default');
mkdir(DATA_DIR . '/Base_Theme/compiled');
mkdir(DATA_DIR . '/Base_Theme/cache');
mkdir(DATA_DIR . '/Base_Theme/config');
$this->install_default_theme_common_files('modules/Base/Theme/', 'images');
Variable::set('default_theme', 'default');
return true;
}
示例7: install
public function install()
{
$this->create_data_dir();
if (!is_dir(DATA_DIR . '/Base_Lang/base')) {
mkdir(DATA_DIR . '/Base_Lang/base');
}
if (!is_dir(DATA_DIR . '/Base_Lang/custom')) {
mkdir(DATA_DIR . '/Base_Lang/custom');
}
ModuleManager::include_common('Base_Lang', 0);
Base_LangCommon::install_translations(Base_LangInstall::module_name());
return Variable::set('default_lang', 'en');
}
示例8: admin
public function admin() {
if ($this->is_back()) {
$this->parent->reset();
}
Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
$google_login = Variable::get('utils_attachments_google_user', false);
$google_pass = Variable::get('utils_attachments_google_pass', false);
$form = $this->init_module('Libs_QuickForm');
$theme = $this->init_module('Base_Theme');
$form->addElement('header', 'header', __('Google Username and Password'));
$form->addElement('text', 'google_user', __('Username'));
$form->addElement('password', 'google_pass', __('Password'));
$form->setDefaults(array('google_user'=>$google_login));
$form->setDefaults(array('google_pass'=>$google_pass));
if ($form->validate()) {
$vals = $form->exportValues();
$ok = true;
if ($vals['google_user']) {
$g_auth = Utils_AttachmentCommon::get_google_auth($vals['google_user'], $vals['google_pass']);
if (!$g_auth) $ok = false;
}
if ($ok) {
Variable::set('utils_attachments_google_user', $vals['google_user']);
Variable::set('utils_attachments_google_pass', $vals['google_pass']);
Base_StatusBarCommon::message(__('Settings saved'));
} else {
Base_StatusBarCommon::message(__('Unable to authenticate'), 'error');
}
location(array());
return;
}
$form->assign_theme('form', $theme);
Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href());
Base_ThemeCommon::load_css('Utils_RecordBrowser','View_entry');
$theme->display('admin');
}
示例9: setDefault
/**
*
* The default may be set to NULL (Text datatype does this) in case default
* should not be listed
* @param type $value
*/
public function setDefault($value)
{
if (is_null($value)) {
if ($this->default instanceof \Variable) {
$this->default->set(null);
} else {
$this->default = null;
}
} elseif ($this->default instanceof \Variable) {
$this->default->set($value);
} else {
$this->default = new \Variable\String((string) $value);
}
return $this;
}
示例10: admin_signature
public function admin_signature()
{
$f = $this->init_module('Libs/QuickForm');
$f->addElement('header', null, __('Outgoing mail global signature'));
$fck =& $f->addElement('ckeditor', 'content', __('Content'));
$fck->setFCKProps('800', '300', true);
$f->setDefaults(array('content' => Variable::get('crm_roundcube_global_signature', false)));
Base_ActionBarCommon::add('save', __('Save'), $f->get_submit_form_href());
if ($f->validate()) {
$ret = $f->exportValues();
$content = $ret['content'];
Variable::set('crm_roundcube_global_signature', $content);
Base_StatusBarCommon::message(__('Signature saved'));
$this->parent->reset();
return;
}
$f->display();
}
示例11: admin
public function admin()
{
if ($this->is_back()) {
$this->parent->reset();
}
$form = $this->init_module('Libs/QuickForm', 'Errors to mail');
$form->addElement('text', 'mail', __('Send bugs to'));
$form->addRule('mail', __('Invalid e-mail address'), 'email');
$form->addElement('static', '', '', __('Leave empty to disable bug reports.'));
Base_ActionBarCommon::add('back', __('Cancel'), $this->create_back_href());
Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href());
$form->setDefaults(array('mail' => Variable::get('error_mail')));
if ($form->validate()) {
Variable::set('error_mail', $form->exportValue('mail'));
$this->parent->reset();
} else {
$form->display();
}
}
示例12: install
public function install()
{
$ret = DB::CreateTable('available_modules', 'name C(128), vkey I NOTNULL, version C(64) NOTNULL', array('constraints' => ', PRIMARY KEY(name, vkey)'));
if ($ret === false) {
die('Invalid SQL query - Setup module (modules table)');
}
$ret = Variable::set('anonymous_setup', true);
if ($ret === false) {
print 'Invalid SQL query - Setup module (populating variables)';
return false;
}
$ret = Variable::set('simple_setup', 1);
if ($ret === false) {
print 'Invalid SQL query - Setup module (populating variables)';
return false;
}
$this->create_data_dir();
Base_ThemeCommon::install_default_theme($this->get_type());
return true;
}
示例13: perform_update_end
protected function perform_update_end()
{
$this->turn_on_maintenance_mode();
Base_ThemeCommon::themeup();
Base_LangCommon::update_translations();
ModuleManager::create_load_priority_array();
Variable::set('version', EPESI_VERSION);
MaintenanceMode::turn_off();
}
示例14: is_update_available
public static function is_update_available($force_check = false)
{
$esu = Variable::get('epesi_store_updates', false);
$today = date('Ymd');
if ($force_check || !is_array($esu) || $esu['check_day'] != $today) {
$updates = self::_count_updates_of_downloaded_modules();
$esu = array('check_day' => $today, 'updates' => $updates);
Variable::set('epesi_store_updates', $esu);
}
return $esu['updates'];
}
示例15: set_store_visibility
public static function set_store_visibility($enabled)
{
Variable::set('base_setup_store_enabled', $enabled ? true : false);
}