/**
  * Add an object to the subject.
  * @param WEBCORE_OBJECT $obj
  */
 public function add_object($obj)
 {
     $this->num_objects += 1;
     $type_info = $obj->type_info();
     if (!isset($this->_items[$type_info->id])) {
         $item = new OBJECT_LIST_TITLE_ITEM();
         $item->type_info = $type_info;
         $this->_items[$type_info->id] = $item;
     }
     $this->_items[$type_info->id]->num_objects += 1;
 }
 /**
  * @param FOLDER $folder Objects are from this folder.
  */
 public function __construct($folder)
 {
     parent::__construct($folder->app);
     $this->_folder = $folder;
     $this->entries = array();
     $this->folders = array();
 }
 /**
  * @param APPLICATION $context Main application.
  */
 public function __construct($context)
 {
     parent::__construct($context);
     include_once 'webcore/gui/page_navigator.php';
     $this->pager = new PAGE_NAVIGATOR($context);
     $this->pager->pages_to_show = 5;
 }
Beispiel #4
0
 /**
  *
  * Create a menu in the given context.
  * @param CONTEXT $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $this->renderer = $this->context->make_menu_renderer();
     $this->renderer->set_size(Menu_size_full);
     $this->renderer->content_mode = Menu_show_all_as_list;
     include_once 'webcore/cmd/commands.php';
     $this->commands = new COMMANDS($context);
 }
Beispiel #5
0
 /**
  * @param CONTEXT $context Attach the query to this object.
  */
 public function __construct($context)
 {
     $this->raise_if_not_is_a($context, 'CONTEXT', 'QUERY', 'QUERY');
     $context->ensure_database_exists();
     // queries always need a database
     parent::__construct($context);
     $this->_restrictions = array();
     $this->_system_restrictions = array();
     $this->_calculated_restrictions = array();
     $this->apply_defaults();
 }
Beispiel #6
0
 /**
  * @param CONTEXT $context Attach to this object.
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $this->page->add_script_file('{scripts}webcore_forms.js');
     if (!isset($this->action)) {
         $this->action = $this->env->url(Url_part_file_name);
     }
     $this->_form_based_field_names[] = 'submitted';
     $this->_update_name();
     $field = new BOOLEAN_FIELD();
     $field->id = 'debug';
     $field->caption = 'Debug';
     $field->visible = false;
     $this->add_field($field);
     if ($this->_captcha_enabled()) {
         $this->captcha = $this->_make_captcha();
         $field = new INTEGER_FIELD();
         $field->id = 'verification_answer';
         $field->caption = 'Verification';
         $field->required = true;
         $field->description = 'Please answer the question above using numerals (not text). This is an anti-spam measure; we apologize for the inconvenience.';
         $this->add_field($field);
         $field = new TEXT_FIELD();
         $field->id = 'verification_question';
         $field->caption = '';
         $field->min_length = 5;
         $field->max_length = 5;
         $field->visible = false;
         $this->add_field($field);
     }
 }
 /**
  * @param CONTEXT $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $class_name = $this->page->final_class_name('PAGE_TITLE', 'webcore/gui/page_title.php');
     $this->title = new $class_name($this->page);
     $this->title->group = $context->description();
     $this->title->prefix = '';
     $this->title->suffix = '';
     $this->base_url = $this->context->url();
     $this->generator = $this->context->description();
     $this->copyright = $this->page->template_options->copyright;
     $this->icon_file = $this->page->template_options->icon;
 }
 /**
  * @param APPLICATION $context Main application.
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $this->_register_formatter(Privilege_range_object, Privilege_view, '{icons}buttons/view', 'View');
     $this->_register_formatter(Privilege_range_object, Privilege_view_history, '{icons}buttons/history', 'View history');
     $this->_register_formatter(Privilege_range_object, Privilege_view_hidden, '{icons}buttons/invisible', 'View hidden');
     $this->_register_formatter(Privilege_range_object, Privilege_create, '{icons}buttons/create', 'Create');
     $this->_register_formatter(Privilege_range_object, Privilege_modify, '{icons}buttons/edit', 'Modify');
     $this->_register_formatter(Privilege_range_object, Privilege_delete, '{icons}buttons/delete', 'Delete');
     $this->_register_formatter(Privilege_range_object, Privilege_purge, '{icons}buttons/purge', 'Purge');
     $this->_register_formatter(Privilege_range_object, Privilege_secure, '{icons}buttons/security', 'Secure');
     $this->_register_formatter(Privilege_range_object, Privilege_upload, '{icons}buttons/upload', 'Upload');
     $this->_register_formatter(Privilege_range_global, Privilege_configure, '{icons}indicators/working', 'Configure');
     $this->_register_formatter(Privilege_range_global, Privilege_offline, '{icons}indicators/offline', 'Offline access');
     $this->_register_formatter(Privilege_range_global, Privilege_subscribe, '{icons}buttons/subscriptions', 'Modify subscriptions');
     $this->_register_formatter(Privilege_range_global, Privilege_password, '{icons}buttons/password', 'Change passwords');
     $this->_register_formatter(Privilege_range_global, Privilege_resources, '{icons}indicators/themes', 'Manage themes/icons');
     $this->_register_formatter(Privilege_range_global, Privilege_login, '{icons}buttons/login', 'Log in');
 }
 /**
  * @param RELEASE $release
  */
 public function __construct($release)
 {
     parent::__construct($release->app);
     $this->release = $release;
     $this->branch = $release->branch();
 }
Beispiel #10
0
 /**
  * @param TREE $tree Decorate this tree.
  */
 public function __construct($tree)
 {
     parent::__construct($tree->context);
     $this->tree = $tree;
 }
 /**
  * @param CONTEXT $context
  * @param integer $num_total_objects Total number of objects that need to be displayed.
  * @param integer $num_objects_per_page Number of objects to show per page.
  */
 public function __construct($context, $num_total_objects = 0, $num_objects_per_page = 0)
 {
     parent::__construct($context);
     $this->separator = $context->display_options->page_separator;
     if ($num_objects_per_page > 0) {
         $this->set_ranges($num_total_objects, $num_objects_per_page);
     }
     $this->page_link = $context->env->url(Url_part_no_host_path);
 }
Beispiel #12
0
 /**
  * @param CONTEXT $context
  * @param string $name
  */
 public function __construct($context, $name)
 {
     parent::__construct($context);
     $this->name = $name;
 }
 public function __construct($context)
 {
     parent::__construct($context);
     $this->options = $this->_make_print_options();
     $this->options->load_from_request();
 }
 /**
  * @param CONTEXT $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
 }
 /**
  * @param CONTEXT $context
  */
 public function __construct($context)
 {
     $this->raise_if_not_is_a($context, 'CONTEXT', 'QUERY', 'QUERY');
     $context->ensure_database_exists();
     // storage always need a database
     parent::__construct($context);
 }
 /**
  * @param CONTEXT $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $this->num_entries = Unassigned;
     $this->page_link = $this->env->url(Url_part_no_host_path);
 }
 /**
  * Copy all values from 'other'.
  * @param THEME_SETTINGS $other
  */
 public function copy_from($other)
 {
     parent::copy_from($other);
     $this->id = $other->id;
     $this->title = $other->title;
     $this->main_CSS_file_name = $other->main_CSS_file_name;
     $this->renderer_class_name = $other->renderer_class_name;
 }
 /**
  * @param CONTEXT $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $this->_add_synced_field('search_text', '');
 }
 /**
  * @param CONTEXT $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $this->_load();
 }
 /**
  * @param RELEASE $rel
  * @param DATE_TIME $occurred Time the event occurred. Need not be valid.
  * @param DATE_TIME $scheduled Time the event is scheduled. Need not be valid.
  * @param boolean $skip_condition Marks an event as skipped if this is true, and the event was scheduled, but has not occurred.
  * @internal param \RELEASE $release
  */
 public function __construct($rel, $occurred, $scheduled, $skip_condition = false)
 {
     parent::__construct($rel->context);
     $this->_release = $rel;
     $this->time_occurred = $occurred;
     $this->time_scheduled = $scheduled;
     $this->_skip_condition = $skip_condition;
     $this->refresh();
 }
 /**
  * @param APPLICATION $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $this->load_from($context);
 }
 /**
  * @param QUERY $query Query to which the restriction is applied.
  * @param USER $user The user for which folders are to be retrieved.
  */
 public function __construct($query, $user)
 {
     parent::__construct($query->context);
     $this->_query = $query;
     $this->_user = $user;
 }
 /**
  * @param PUBLISHER $publisher
  * @param SUBSCRIBER $subscriber
  */
 public function __construct($publisher, $subscriber)
 {
     parent::__construct($publisher->context);
     $this->_publisher = $publisher;
     $this->subscriber = $subscriber;
     $this->identifier = "[{$subscriber->send_as_html}]";
     $class_name = $this->app->final_class_name('PUBLISHER_MESSAGE_SUBJECT');
     $this->_subject = new $class_name($this->context);
 }
 /**
  * @param APPLICATION $context
  * @param integer[] $from
  * @param integer $to
  */
 public function __construct($context, $from, $to)
 {
     parent::__construct($context);
     $this->from = join(',', $from);
     $this->to = $to;
 }
 /**
  * @param QUERY $com_query Show comments from this query.
  * @param ENTRY|COMMENT $obj Entry or comment on whose page to render comments.
  * @param string $default_mode Default mode for comment display (Can be 'Comment_render_flat' or 'Comment_render_threaded').
  */
 public function __construct($com_query, $obj, $default_mode = Comment_render_threaded)
 {
     parent::__construct($obj->app);
     $this->_comment_query = $com_query;
     $this->_obj = $obj;
     if (is_a($this->_obj, 'COMMENT')) {
         $this->_comment = $this->_obj;
     }
     $this->comment_mode = read_var('comment_mode', $default_mode);
 }
 /**
  * @param FORM $form Attach to this object.
  */
 public function __construct($form)
 {
     parent::__construct($form->context);
     $this->_form = $form;
 }
 /**
  * @param APPLICATION $context Main application.
  * @param integer $default Default time frame to show.
  * @see Time_frame_recent
  */
 public function __construct($context, $default = Time_frame_recent)
 {
     parent::__construct($context);
     $this->load_period_from_request($default);
     $this->page_link = $context->env->url(Url_part_no_host_path);
 }
 /**
  * @param CONTEXT $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $this->format = read_var('format', Newsfeed_format_rss);
     $this->content = read_var('content', Newsfeed_content_html);
 }
Beispiel #29
0
 /**
  * @param PANEL_MANAGER $manager Owner of this panel.
  */
 public function __construct($manager)
 {
     parent::__construct($manager->app);
     $this->_panel_manager = $manager;
 }
Beispiel #30
0
 /**
  * @param CONTEXT $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $this->logs = new LOGGER_CONTAINER();
 }