/** * @param ATTACHMENT_HOST $host */ public function __construct($host) { $this->_host = $host; $folder = $host->parent_folder(); parent::__construct($folder); }
/** * Return default handler objects for supported tasks. * @param string $handler_type Specific functionality required. * @param OBJECT_RENDERER_OPTIONS $options * @return object * @access private */ protected function _default_handler_for($handler_type, $options = null) { switch ($handler_type) { case Handler_print_renderer: case Handler_html_renderer: case Handler_text_renderer: include_once 'webcore/gui/folder_renderer.php'; return new FOLDER_RENDERER($this->app, $options); case Handler_commands: include_once 'webcore/cmd/folder_commands.php'; return new FOLDER_COMMANDS($this); case Handler_history_item: include_once 'webcore/obj/webcore_history_items.php'; return new FOLDER_HISTORY_ITEM($this->app); case Handler_subscriptions: include_once 'webcore/gui/subscription_renderer.php'; return new FOLDER_SUBSCRIPTION_RENDERER($this->app, $options); default: return parent::_default_handler_for($handler_type, $options); } }
/** * Set the parent object for this attachment. * Does not store to the database. Sets up both the host and the folder information * for this attachment; used during object setup when retrieved from database. * @param ATTACHMENT_HOST $host */ public function set_host($host) { $this->set_parent_folder($host->parent_folder()); $this->_host = $host; $this->object_id = $host->id; }
/** * Return default handler objects for supported tasks. * @param string $handler_type Specific functionality required. * @param OBJECT_RENDERER_OPTIONS $options * @return object * @access private */ protected function _default_handler_for($handler_type, $options = null) { switch ($handler_type) { case Handler_navigator: include_once 'webcore/gui/entry_navigator.php'; return new ENTRY_NAVIGATOR($this); case Handler_commands: include_once 'webcore/cmd/entry_commands.php'; return new ENTRY_COMMANDS($this); case Handler_history_item: include_once 'webcore/obj/webcore_history_items.php'; return new ENTRY_HISTORY_ITEM($this->app); case Handler_rss_renderer: include_once 'webcore/gui/rss_renderer.php'; return new ENTRY_RSS_RENDERER($this->app, $options); case Handler_atom_renderer: include_once 'webcore/gui/atom_renderer.php'; return new ENTRY_ATOM_RENDERER($this->app, $options); case Handler_associated_data: include_once 'webcore/gui/entry_renderer.php'; return new ENTRY_ASSOCIATED_DATA_RENDERER($this->app, $options); case Handler_subscriptions: include_once 'webcore/gui/subscription_renderer.php'; return new ENTRY_SUBSCRIPTION_RENDERER($this->app, $options); default: return parent::_default_handler_for($handler_type, $options); } }