本文整理汇总了PHP中read_var函数的典型用法代码示例。如果您正苦于以下问题:PHP read_var函数的具体用法?PHP read_var怎么用?PHP read_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了read_var函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param APPLICATION $context
*/
public function __construct($context)
{
parent::__construct($context);
$cmd = $this->make_command();
$cmd->id = 'create';
$cmd->caption = 'New user';
$cmd->link = "create_user.php";
$cmd->icon = '{icons}buttons/create';
$cmd->executable = $this->login->is_allowed(Privilege_set_user, Privilege_create);
$cmd->importance = Command_importance_high + Command_importance_increment;
$this->append($cmd);
$link_url = new URL($this->env->url(Url_part_no_host_path));
$link_url->replace_argument('show_anon', '');
$cmd = $this->make_command();
$cmd->id = 'show_registered';
$cmd->caption = 'Show registered users';
$cmd->link = $link_url->as_text();
$cmd->icon = '{icons}buttons/login';
$cmd->executable = read_var('show_anon');
$cmd->importance = Command_importance_high;
$this->append($cmd);
$link_url->replace_argument('show_anon', 1);
$cmd = $this->make_command();
$cmd->id = 'show_anonymous';
$cmd->caption = 'Show anonymous users';
$cmd->link = $link_url->as_text();
$cmd->icon = '{icons}buttons/anonymous';
$cmd->executable = !read_var('show_anon');
$cmd->importance = Command_importance_high;
$this->append($cmd);
}
示例2: load_with_defaults
/**
* Initialize the form's fields with default values and visibilities.
*/
public function load_with_defaults()
{
parent::load_with_defaults();
$icon_url = read_var('icon_url');
if ($icon_url) {
$this->set_value('icon_url', $icon_url);
}
}
示例3: load_with_defaults
/**
* Initialize the form's fields with default values and visibilities.
*/
public function load_with_defaults()
{
parent::load_with_defaults();
$this->set_value('state', Planned);
$branch_id = read_var('id');
if (empty($branch_id)) {
if (!empty($this->_branches)) {
$this->set_value('branch_id', $this->_branches[0]->id);
}
} else {
$this->set_value('branch_id', $branch_id);
}
}
示例4: load_with_defaults
/**
* Initialize the form's fields with default values and visibilities.
*/
public function load_with_defaults()
{
parent::load_with_defaults();
$job_id = read_var('job_id');
if (empty($job_id)) {
$this->load_from_client('job_id', 0);
$job_id = $this->value_for('job_id');
}
$job = $this->job_at($job_id);
if (isset($job)) {
$this->set_value('job_id', $job_id);
$this->add_preview($job, 'Attached to job: ' . $job->title_as_html(), !$this->previewing());
} else {
$this->set_value('job_id', 0);
}
}
示例5: load_with_defaults
/**
* Initialize the form's fields with default values and visibilities.
*/
public function load_with_defaults()
{
parent::load_with_defaults();
$this->set_value('state', Visible);
$branch_id = read_var('branch_id', 0);
if ($branch_id > 0) {
/** @var PROJECT_APPLICATION $project_application */
$project_application = $this->app;
$branch = $project_application->branch_at_id($branch_id);
if (isset($branch)) {
$release = $branch->latest_release();
if (isset($release)) {
$this->set_value('parent_release_id', $release->id);
}
}
}
}
示例6: load_from_object
public function load_from_object($obj)
{
parent::load_from_object($obj);
$this->load_with_defaults();
$this->set_value('send_to', $this->context->mail_options->webmaster_address);
$this->set_value('include_browser_info', true);
$this->set_value('include_page_data', true);
$class_name = read_var('class_name');
$routine_name = read_var('routine_name');
if ($routine_name) {
if ($class_name) {
$this->set_value('subject', "Exception in method [{$class_name}.{$routine_name}]");
} else {
$this->set_value('subject', "Exception in function [{$routine_name}]");
}
} else {
$this->set_value('subject', 'Exception at global scope');
}
}
示例7: _adjust_query
/**
* Modify the query to navigate.
* @param QUERY $query
* @access private
*/
protected function _adjust_query($query)
{
$calendar = read_var('calendar');
$first_day = read_var('first_day');
$last_day = read_var('last_day');
$folder = $this->_entry->parent_folder();
if ($calendar) {
$this->page->location->append("Calendar", "view_calendar.php?id={$folder->id}");
}
if ($first_day) {
$day = $this->app->make_date_time($first_day, Date_time_iso);
$url = new URL($this->env->url(Url_part_no_host_path));
$url->replace_argument('id', $folder->id);
$url->replace_name_and_extension('view_journals.php');
$this->page->location->append($folder->format_date($day), $url->as_text());
$query->set_days($first_day, $last_day);
}
$query->set_order('date ASC');
parent::_adjust_query($query);
}
示例8: _adjust_query
/**
* Modify the query to navigate.
* @param QUERY $query
* @access private
*/
protected function _adjust_query($query)
{
parent::_adjust_query($query);
$journal_id = read_var('journal');
$first_day = read_var('first_day');
$last_day = read_var('last_day');
if ($journal_id) {
/** @var ALBUM $folder */
$folder = $this->_entry->parent_folder();
$journal_query = $folder->entry_query();
/** @var JOURNAL $journal */
$journal = $journal_query->object_at_id($journal_id);
if (isset($journal)) {
$journal->adjust_query($query);
}
}
if (!$journal_id && $first_day) {
$query->set_days($first_day, $last_day);
}
$query->order_by_day('ASC');
}
示例9:
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with earthli WebCore; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For more information about the earthli WebCore, visit:
http://www.earthli.com/software/webcore
****************************************************************************/
$theme_query = $App->theme_query();
/** @var $theme THEME */
$theme = $theme_query->object_at_id(read_var('id'));
if (isset($theme) && $App->login->is_allowed(Privilege_set_global, Privilege_resources)) {
$class_name = $App->final_class_name('DELETE_FORM', 'webcore/forms/delete_form.php');
/** @var $form DELETE_FORM */
$form = new $class_name($App);
$form->process_existing($theme);
if ($form->committed()) {
$Env->redirect_local("view_themes.php");
}
$Page->location->add_root_link();
$Page->location->append('Themes', 'view_themes.php');
$Page->title->add_object($theme);
$Page->title->subject = 'Delete theme';
$Page->location->add_object_link($theme);
$Page->location->append($Page->title->subject, '', '{icons}buttons/delete');
$Page->start_display();
示例10: load_from_request
public function load_from_request()
{
$this->upload_max_filesize = text_to_file_size(ini_get('upload_max_filesize'));
$this->post_max_size = text_to_file_size(ini_get('post_max_size'));
$this->ini_max_file_size = min($this->upload_max_filesize, $this->post_max_size);
$this->max_file_size = $this->ini_max_file_size;
$this->form_max_file_size = read_var(Form_max_file_size_field_name, 0);
if ($this->form_max_file_size && $this->form_max_file_size < $this->max_file_size) {
$this->max_file_size = $this->form_max_file_size;
}
$this->_file_sets = array();
$this->total_files = 0;
foreach ($_FILES as $file_set_id => $file_info) {
$file_set = new UPLOADED_FILE_SET($this, $file_set_id);
if ($file_set->size()) {
$this->total_files += $file_set->size();
$this->file_sets[$file_set_id] = $file_set;
}
}
/*
In order to smoothly support uploading with form validation, we allow a form to process
a previously uploaded file and store its properties in the form. The uploader reads those
values and 'pretends' that this is a valid PHP upload file. This way, form validation can
occur over multiple submissions but a successfully uploaded file need only be uploaded once.
*/
$uploads = read_var($this->stored_info_name);
if (is_array($uploads)) {
for ($idx = sizeof($uploads) - 1; $idx >= 0; $idx--) {
$upload = $uploads[$idx];
$file = new UPLOADED_FILE($this, '', 0, '', '', 0);
$file_set_id = $file->load_from_text($upload);
if (isset($this->file_sets[$file_set_id])) {
$file_set = $this->file_sets[$file_set_id];
} else {
$file_set = new UPLOADED_FILE_SET($this, $file_set_id);
$this->file_sets[$file_set_id] = $file_set;
}
array_unshift($file_set->files, $file);
}
}
}
示例11: foreach
} else {
$indexed_kinds = $App->entry_kinds();
foreach ($indexed_kinds as $kind) {
$kinds[strtolower($kind->title)] = $kind;
}
$App->impersonate($App->mail_options->publisher_user_name, $App->mail_options->publisher_user_password);
$folder_query = $App->login->folder_query();
$folders = $folder_query->indexed_objects();
$App->display_options->show_local_times = false;
while ($data = fread($fhandle, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fhandle))) {
raise(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)));
}
}
xml_parser_free($xml_parser);
$commit = !read_var('testing');
if (isset($errors_occurred)) {
log_message("[{$errors_occurred}] errors detected. Objects not imported.", Msg_type_warning, Msg_channel_xml);
} else {
if ($commit) {
$action = 'Imported';
} else {
$action = 'Found';
}
$count = sizeof($objs);
log_message("[{$count}] changes found. Importing...", Msg_type_info, Msg_channel_xml);
$index = 0;
while ($index < $count) {
$obj = $objs[$index];
$folder = $obj->parent_folder();
$creator = $obj->creator();
示例12: read_var
****************************************************************************/
$id = read_var('id');
$folder_query = $App->login->folder_query();
$folder = $folder_query->folder_for_entry_at_id($id);
if (isset($folder)) {
$entry_query = $folder->entry_query();
/* Set this global value to optimize the query for accessing the particular
type of entry. */
if (isset($entry_type_id)) {
$entry_query->set_type($entry_type_id);
}
$entry = $entry_query->object_at_id($id);
}
if (isset($entry) && $App->login->is_allowed(Privilege_set_entry, Privilege_view, $entry)) {
$App->set_referer();
$App->set_search_text(read_var('search_text'));
$entry_info = $entry->type_info();
$location_renderer = $entry->handler_for(Handler_location);
$location_renderer->add_to_page_as_link($Page, $entry);
$Page->location->append('Plain text', '', '{icons}indicators/text');
$Page->add_style_sheet($Env->logger_style_sheet);
$navigator = $entry->handler_for(Handler_navigator);
$navigator->set_query($entry_query);
$navigator->set_selected($id);
$Page->start_display();
?>
<div class="main-box">
<pre class="log-box">
<?php
/** @var ENTRY_RENDERER $renderer */
$renderer = $entry->handler_for(Handler_text_renderer);
示例13:
earthli WebCore is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
earthli WebCore is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with earthli WebCore; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For more information about the earthli WebCore, visit:
http://www.earthli.com/software/webcore
****************************************************************************/
$folder_query = $App->login->folder_query();
$folder = $folder_query->object_at_id(read_var('id'));
if (isset($folder) && $App->login->is_allowed(Privilege_set_folder, Privilege_view_history, $folder)) {
$Page->title->add_object($folder);
$Page->location->add_folder_link($folder);
$history_item_query = $folder->history_item_query();
$obj = $folder;
include_once 'webcore/pages/view_history.php';
} else {
$Page->raise_security_violation('You are not allowed to view this folder\'s history.');
}
示例14: load_with_defaults
/**
* Initialize the form's fields with default values and visibilities.
*/
public function load_with_defaults()
{
parent::load_with_defaults();
$this->load_from_client('thumbnail_size', 200);
$this->load_from_client('overwrite', true);
$this->load_from_client('create_thumbnail', true);
$this->set_value('type', read_var('type'));
}
示例15: read_var
earthli WebCore is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with earthli WebCore; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For more information about the earthli WebCore, visit:
http://www.earthli.com/software/webcore
****************************************************************************/
$id = read_var('id');
$folder_query = $App->login->folder_query();
$folder = $folder_query->folder_for_comment_at_id($id);
if (isset($folder)) {
$entry_query = $folder->entry_query();
$entry = $entry_query->object_for_comment_at_id($id);
if (isset($entry)) {
$com_query = $entry->comment_query();
$comment = $com_query->object_at_id($id);
}
}
if (isset($comment) && $App->login->is_allowed(Privilege_set_comment, Privilege_view_history, $comment)) {
$Page->title->add_object($folder);
$Page->title->add_object($entry);
$Page->title->add_object($comment);
$Page->location->add_folder_link($folder);