本文整理汇总了PHP中Setting::value方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::value方法的具体用法?PHP Setting::value怎么用?PHP Setting::value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Initializer.
*
* @access public
* @return BaseController
*/
public function __construct()
{
$is_admin = Request::is('admin*');
$is_backend = Request::is('backend*');
/* Set middleware(s) based on route URLs */
if ($is_admin || $is_backend) {
$this->middleware('auth');
if ($is_backend) {
// Backend specific middleware
$this->middleware('auth.backend');
}
$this->middleware('auth.permissions');
if (!Request::is('*users/change-password')) {
// No validation for stale password if password is being changed
$this->middleware('auth.pw_6_months');
}
}
list($this->link_type, $this->link, $this->layout, $this->current_theme) = current_section();
View::share('link_type', $this->link_type);
View::share('current_theme', $this->current_theme);
$website_settings = Setting::lists('value', 'name')->all();
View::share('website_settings', $website_settings);
$locale = Setting::value('language');
App::setLocale($locale);
Lang::setLocale($locale);
$this->user = current_user();
View::share('current_user', $this->user);
View::share('current_user_companies', current_user_companies());
}
示例2: status
public function status()
{
if (Setting::value("{$this->target}_theme") == $this->id) {
return 'Applied';
} else {
return 'Not Applied';
}
}
示例3: assets
public function assets()
{
if ($this->user->can('edit_all_assets')) {
$this->elfinder(NULL, trim(Setting::value('assets_folder', 'iu-assets'), '/'));
} else {
@mkdir(Setting::value('assets_folder', 'iu-assets') . '/' . $this->user->id, 0777, true);
$this->elfinder(NULL, trim(Setting::value('assets_folder', 'iu-assets') . '/' . $this->user->id, '/'));
}
}
示例4: __construct
public function __construct()
{
parent::__construct();
//$this->output->enable_profiler(TRUE);
//check if config file is empty or it's not empty but script is not installed
if ((is_db_conf_empty() || !is_installed()) && !defined('CS_EXTERNAL')) {
redirect("setup/index");
}
//load database, datamapper and login manager
$this->load->database();
$this->load->library('datamapper');
$this->load->library('translate');
$this->load->library('loginmanager');
//hack for datamapper prefix
DataMapper::$config['prefix'] = $this->db->dbprefix;
//set web site name in title
$this->templatemanager->set_title(Setting::value('website_title', CS_PRODUCT_NAME));
//test if should save uri
$should = true;
if ($this instanceof Process) {
$uri = $path = trim($this->uri->uri_string());
$file = new File();
$file->path = $path;
$mime = $file->mime_type();
if ($mime !== 'text/html') {
$should = false;
}
}
//set current url for auth controller to know where to redirect
if (!$this instanceof Auth && !$this instanceof JS && !$this->is_ajax_request() && $should) {
$this->loginmanager->set_redirect(current_url());
}
//set time zone
date_default_timezone_set(Setting::value('default_time_zone', 'Europe/Belgrade'));
//set language
$sess_lang = $this->session->userdata('lang');
if (!empty($sess_lang)) {
if (is_numeric($sess_lang)) {
$lang = Language::factory()->get_by_id((int) $sess_lang)->name;
} else {
$lang = $sess_lang;
}
} else {
$lang = Setting::value('default_language', 'English');
}
$this->translate->set_language($lang);
//fetch user from the database if logged in
if ($this->loginmanager->is_logged_in()) {
$this->user = User::factory($this->loginmanager->user->id);
$this->templatemanager->assign('user', $this->user);
}
$this->templatemanager->set_template_name($this->in_admin() ? "administration" : "");
if ($this->in_admin() && isset($_GET['iu-popup'])) {
$this->templatemanager->popup();
}
}
示例5: exportsql
public function exportsql($zipped = false)
{
$this->load->dbutil();
$sql = $this->dbutil->backup(array('format' => 'txt'));
if (!empty($zipped)) {
$this->load->library('zip');
$this->zip->add_data(Setting::value("website_title", CS_PRODUCT_NAME) . '.sql', $sql);
$this->zip->download(Setting::value("website_title", CS_PRODUCT_NAME) . '.sql.zip');
} else {
$this->load->helper('download');
force_download(Setting::value("website_title", CS_PRODUCT_NAME) . '.sql', $sql);
}
}
示例6: __construct
/**
* Initializer.
*
* @access public
* @return BaseController
*/
public function __construct()
{
list($this->link_type, $this->link, $this->layout, $this->current_theme) = current_section();
View::share('link_type', $this->link_type);
View::share('current_theme', $this->current_theme);
$website_settings = Setting::lists('value', 'name');
View::share('website_settings', $website_settings);
$locale = Setting::value('language');
App::setLocale($locale);
Lang::setLocale($locale);
$this->user = current_user();
View::share('current_user', $this->user);
View::share('current_user_companies', current_user_companies());
}
示例7: postContact
public function postContact()
{
$input = Input::all();
$rules = array('email' => 'required|min:5|email', 'name' => 'required|alpha|min:5');
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
try {
Mail::send('public.' . $this->current_theme . '.email', $input, function ($message) use($input) {
$message->from($input['email'], $input['name']);
$message->to(Setting::value('email_username'), $input['name'])->subject($input['subject']);
});
} catch (Exception $e) {
return Redirect::back()->withInput()->with('error_message', $e->getMessage());
}
return Redirect::back()->with('success_message', trans('success_messages.mail_sent'));
}
示例8: export
public function export()
{
$export_data = $this->input->post("export_data");
$export_images = $this->input->post("export_images");
$export_assets = $this->input->post("export_assets");
if ($export_data) {
$sql = $this->dbutil->backup(array('format' => 'txt'));
$this->zip->add_data('database.sql', $sql);
}
if ($export_images) {
$path = str_replace("\\", "/", FCPATH . "images\\");
$this->zip->read_dir($path, false);
}
if ($export_assets) {
$path = str_replace("\\", "/", FCPATH . "assets\\");
$this->zip->read_dir($path, false);
}
$this->zip->download(cyr_url_title(Setting::value("website_title", CS_PRODUCT_NAME)) . ".zip");
}
示例9: quick_upload
public function quick_upload()
{
$assetdir = Setting::value('assets_folder', 'iu-assets') . '/' . $this->user->id;
@mkdir($assetdir, 0777, true);
$assetpath = realpath(trim($assetdir, '/')) . '/';
$assetbase = rel2abs($assetdir, trim(base_url(), '/') . '/');
// Optional: instance name (might be used to adjust the server folders for example)
$CKEditor = $_GET['CKEditor'];
// Required: Function number as indicated by CKEditor.
$funcNum = $_GET['CKEditorFuncNum'];
// Optional: To provide localized messages
$langCode = $_GET['langCode'];
// The returned url of the uploaded file
$url = '';
// Optional message to show to the user (file renamed, invalid file, not authenticated...)
$message = '';
// in CKEditor the file is sent as 'upload'
if (isset($_FILES['upload'])) {
$config = array();
$config['upload_path'] = $assetdir;
$config['allowed_types'] = '*';
$this->load->library('upload', $config);
if (!$this->upload->do_upload('upload')) {
$message = $this->upload->display_errors();
} else {
$data = $this->upload->data();
if (stripos(current_url(), 'instant-update.com') && empty($data['is_image'])) {
die(json_encode($result));
}
$url = $assetbase . '/' . $data['file_name'];
//$result['url'] = base_url() . 'iu-assets/'.$this->user->id.'/'.$data['file_name'];
$message = 'The file has been uploaded';
}
} else {
$message = 'No file has been sent';
}
// ------------------------
// Write output
// ------------------------
// We are in an iframe, so we must talk to the object in window.parent
echo "<script type='text/javascript'> window.parent.CKEDITOR.tools.callFunction({$funcNum}, '{$url}', '{$message}')</script>";
}
示例10: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
DB::table('members_packages')->whereRaw("UNIX_TIMESTAMP(expiration) <= " . strtotime("NOW"))->update(array('status' => 0));
echo "Membership packages has been updated.";
// SENDS EMAIL TO THE MEMBERS WITH EXPIRED PACKAGES
if (Setting::value('email_users_expire') == 'yes') {
// FIND THE MEMBERS
$packages = Memberpackage::where('status', '=', 0)->where('expiration', '=', date("Y-m-d 00:00:00"))->get();
foreach ($packages as $package) {
if ($package->member->email != '') {
$data = array('package' => $package->package->service->name, 'date' => date("F j,Y", strtotime($package->expiration)), 'name' => $package->member->first_name);
Mail::queue('emails.expired', $data, function ($message) use($package) {
$message->to($package->member->email, $package->member->first_name)->subject('You package has expired.');
});
} else {
// SEND THROUGH SMS INSTEAD ( FUTURE FEATURE)
}
}
}
}
示例11: backupDB
/**
* Create backup of the current database
* @param string $current_time "Current time in string"
*/
public function backupDB($current_time)
{
$this->dbConnections();
$destination = backup_path() . "/backup/db/";
// Clean the backup directory, before making any backup
File::cleanDirectory(backup_path());
File::makeDirectory(backup_path() . "/backup");
File::makeDirectory($destination);
$backup_filename = 'database_backup.sql';
$path = \Setting::value('mysqldump_path', 'mysqldump');
if (false) {
if ($this->password == '') {
//without password
$command = $path . " -u " . $this->username . " " . $this->database . " > " . $destination . $backup_filename;
} else {
//with password
$command = $path . " -u " . $this->username . " -p " . $this->password . " " . $this->database . " > " . $destination . $backup_filename;
}
system($command);
} else {
$this->backupTables($this->host, $this->username, $this->password, $this->database, $destination . $backup_filename);
}
}
示例12: current_section
/**
* Get the information whether the current section is backend, admin or public
* @return array
*/
function current_section()
{
if (Schema::hasTable('themes') && Theme::all()->count() == 0) {
// If for some reason, there are no themes in theme table, seed with the default data
Artisan::call('db:seed', array('ThemesTableSeeder'));
}
if (Request::is('backend*') || Request::is('login/backend*')) {
$link_type = 'backend';
$link = 'backend/';
$theme = Schema::hasTable('themes') ? Theme::find(Setting::value('backend_theme', 1))->directory : 'default';
$layout = "backend.{$theme}._layouts._layout";
} elseif (Request::is('admin*') || Request::is('login/admin*')) {
$link_type = 'admin';
$link = 'admin/';
$theme = Schema::hasTable('themes') ? Theme::find(Setting::value('admin_theme', 1))->directory : 'default';
$layout = "admin.{$theme}._layouts._layout";
} else {
$link_type = 'public';
$link = '';
$theme = Schema::hasTable('themes') ? Theme::find(Setting::value('public_theme', 1))->directory : 'default';
$layout = "public.{$theme}._layouts._layout";
}
return array($link_type, $link, $layout, $theme);
}
示例13: resetpass
public function resetpass($id, $key)
{
$u = User::factory()->where('id', (int) $id)->where("key", $key)->get();
if ($u->exists()) {
$u->key = '';
$u->active = 1;
$u->salt = '';
$p = random_string();
$u->password = $p;
$u->save();
//set variables for template
$vars = array('name' => $u->name, 'email' => $u->email, 'password' => $p, 'website_title' => Setting::value('website_title', CS_PRODUCT_NAME), 'site_url' => site_url());
//get email template
$template = file_get_contents(APPPATH . "templates/new_password.html");
$template = __($template, null, 'email');
$template .= "<br />\n<br />\n<br />\n" . __(file_get_contents(APPPATH . "templates/signature.html"), null, 'email');
$template = parse_template($template, $vars);
//send email
$this->email->to("{$u->name} <{$u->email}>");
$this->email->subject(__("%s password reset", Setting::value('website_title', CS_PRODUCT_NAME), 'email'));
$this->email->message($template);
$this->email->set_alt_message(strip_tags($template));
$from = Setting::value("default_email", false);
if (empty($from)) {
$from = "noreply@" . get_domain_name(true);
}
$this->email->from($from);
$sent = $this->email->send();
if ($sent) {
$this->templatemanager->notify_next(__("New password is set. Please check your e-mail."), "success", __("Success"));
} else {
$this->templatemanager->notify_next(__("E-mail could not be sent!"), "error", __("Error"));
}
} else {
$this->templatemanager->notify_next(__("Invalid key or password already reset."), "error", __("Error"));
}
redirect("administration/auth/login");
}
示例14: software
</div>
<?php
if ($template->config['has_footer']) {
?>
<!-- Footer line -->
<div id="footer">
<?php
$first = Setting::value('custom_footer_text', '');
$second = Setting::value('custom_footer_text2', '');
if (empty($first)) {
$first = 'Content Management System provided by <a href="http://instant-update.com">Instant Update ' . get_app_version() . '</a>';
}
if (empty($second)) {
$second = 'You can brand Instant Update as your own software (Settings > Branding).';
}
?>
<div class="left"><?php
echo $first;
?>
</div>
<div class="right"><?php
echo $second;
?>
</div>
</div>
<?php
}
?>
<?php
示例15: remove_image
function remove_image(id)
{
$.get(IU_SITE_URL+'/administration/repeatables/ajax_removeimage/'+id, function () {
$('#item-image').fadeOut();
}, 'json');
}
$(document).ready(function() {
$( ".datepicker" ).datepicker({
autoSize: true,
appendText: '(<?php
echo Setting::value('datepicker_format', 'dd/mm/yy');
?>
)',
dateFormat: '<?php
echo Setting::value('datepicker_format', 'dd/mm/yy');
?>
'
});
});
<?php
if ($template->config['has_header']) {
?>
var myheight = screen.height;
<?php
} else {
?>
var myheight = Math.floor(screen.height * 0.6);
<?php
}