/** * @param FOLDER $folder Update subscribers to this folder. */ public function __construct($folder) { parent::__construct($folder->app); $this->_folder = $folder; $field = new ARRAY_FIELD(); $field->id = 'subscriber_ids'; $field->caption = 'Subscribers'; $this->add_field($field); }
/** * @param APPLICATION $context Main application. */ public function __construct($context) { parent::__construct($context); $field = new TITLE_FIELD(); $field->id = 'name'; $field->caption = 'User Name'; $field->required = true; $this->add_field($field); }
/** * @param USER $user Delete this user. */ public function __construct($user) { parent::__construct($user->app); $this->_user = $user; $field = new TITLE_FIELD(); $field->id = 'name'; $field->caption = 'User Name'; $field->required = true; $field->visible = false; $this->add_field($field); }
/** * @param APPLICATION $context */ public function __construct($context) { parent::__construct($context); $field = new ENUMERATED_FIELD(); $field->id = 'copy_mode'; $field->caption = ''; $field->add_value(Security_copy_none); $field->add_value(Security_copy_current); $field->add_value(Security_create_admin); $this->add_field($field); }
/** * @param FOLDER $folder Add subscribers to this folder. */ public function __construct($folder) { parent::__construct($folder->app); $this->_folder = $folder; $field = new TEXT_FIELD(); $field->id = 'emails'; $field->caption = 'Subscribers'; $field->description = 'Place each email on its own line in the list.'; $field->required = true; $this->add_field($field); }
/** * @param FOLDER $folder Objects are from this folder. */ public function __construct($folder) { parent::__construct($folder->app); $this->_folder = $folder; $field = new ARRAY_FIELD(); $field->id = 'folder_ids'; $field->caption = 'Folders'; $field->visible = false; $this->add_field($field); $field = new ARRAY_FIELD(); $field->id = 'entry_ids'; $field->caption = 'Entries'; $field->visible = false; $this->add_field($field); $this->object_list = new OBJECT_LIST_BUILDER($folder); }
/** * @param FOLDER $folder */ public function __construct($folder) { parent::__construct($folder->app); $this->_folder = $folder; $field = new UPLOAD_FILE_FIELD(); $field->id = 'zipfile'; $field->caption = 'Zip file'; $field->description = 'Please specify a zip file containing your pictures.'; $field->required = true; $field->max_bytes = text_to_file_size('30MB'); $this->add_field($field); $field = new MUNGER_TITLE_FIELD(); $field->id = 'title'; $field->caption = 'Title'; $field->description = 'Each picture entry will have this title. Use {#} to include the picture number and {file} to include the file name without the extension. For example, if the title is \'Picture {#} - {file}\', file1.jpg will have the title \'Picture 1 - file1\').'; $field->required = true; $this->add_field($field); $field = new BOOLEAN_FIELD(); $field->id = 'read_exif'; $field->caption = 'Read EXIF info'; $this->add_field($field); $field = new DATE_TIME_FIELD(); $field->id = 'day'; $field->caption = 'Day'; $field->required = true; $this->add_field($field); $field = new BOOLEAN_FIELD(); $field->id = 'create_thumbnail'; $field->caption = 'Create thumbnails'; $this->add_field($field); $field = new INTEGER_FIELD(); $field->id = 'thumbnail_size'; $field->caption = 'Thumbnail size'; $field->min_value = 32; $field->max_value = 300; $this->add_field($field); $field = new INTEGER_FIELD(); $field->id = 'starting_index'; $field->caption = 'First number'; $field->required = true; $field->description = 'Set the next number to use for {#} in the title (if uploading in multiple batches).'; $field->min_value = 1; $this->add_field($field); }
/** * Initialize the form with a search object. * If the search is <c>null</c>, the form will be shown in "quick search" * mode. This shows only the text search and a drop-down to select the type * of object to search. * @param APPLICATION $context Main application. * @param SEARCH $search Build the form based on this search object. */ public function __construct($context, $search) { parent::__construct($context); $this->_search = $search; $entry_type_infos = $this->app->entry_type_infos(); $type = $entry_type_infos[0]->id; if (isset($this->_search)) { $search->fields->add_fields($this); } else { $this->action_anchor = ''; $field = new TEXT_FIELD(); $field->id = 'search_text'; $field->caption = ''; $this->add_field($field); $search_template = $this->app->make_search($type); $search_template->fields->add_fields($this, false); } $field = new BOOLEAN_FIELD(); $field->id = 'quick_search'; $field->caption = 'Quick Search'; $field->visible = false; $field->set_value(true); $this->add_field($field); $field = new ENUMERATED_FIELD(); $field->id = 'type'; $field->caption = ''; $field->visible = !isset($this->_search); /* Fill with all the registered search types. */ $type_infos = $this->app->search_type_infos(); foreach ($type_infos as $t) { $field->add_value($t->id); } $this->add_field($field); /* Set the first entry type as the default search. */ if (!empty($entry_type_infos)) { $this->set_value('type', $type); } }