get_description(); return array( array( 'id' => __CLASS__, 'caption' => $desc['displayName'], 'hint' => $desc['description'], 'onExecute' => 'javaScript:app.home.add', 'acceptedTypes' => $this->accept_drop(), 'allowOnMultiple' => $this->accept_multiple() )); } /** * Generate the display for the portlet * * @param id String unique ID, provided to the portlet so it can make sure content is * unique, if needed. * @param Etemplate $etemplate eTemplate to generate content */ public abstract function exec($id = null, Etemplate &$etemplate = null); /** * Return a list of settings to customize the portlet. * * Settings should be in the same style as for preferences. It is OK to return an empty array * for no customizable settings. * * These should be already translated, no further translation will be done. * * @see preferences/inc/class.preferences_settings.inc.php * @return Array of settings. Each setting should have the following keys: * - name: Internal reference * - type: Widget type for editing * - label: Human name * - help: Description of the setting, and what it does * - default: Default value, for when it's not set yet */ public function get_properties() { // Include the common attributes, or they won't get saved $properties = array(); foreach(self::$common_attributes as $prop) { $properties[$prop] = array('name' => $prop); } $properties[] = array( 'name' => 'color', 'type' => 'colorpicker', 'label' => lang('Color'), ); return $properties; } /** * Return a list of allowable actions for the portlet. * * These actions will be merged with the default portlet actions. Use the * same id / key to override the default action. */ public abstract function get_actions(); /** * If this portlet can accept, display, or otherwise handle multiple * EgroupWare entries. Used for drag and drop processing. How the entries * are handled are up to the portlet. */ public function accept_multiple() { return false; } /** * If this portlet can be created by dropping, these are the drop types * that are accepted * * @return boolean|String[] */ public function accept_drop() { // In general, no return false; } public function __toString() { return get_called_class() . ' Context:' . array2string($this->context); } }