short_desc = $this->T_('Short description'); $this->long_desc = $this->T_('Longer description. You may also remove this.'); } /** * Define the GLOBAL settings of the plugin here. These can then be edited in the backoffice in System > Plugins. * * @param array Associative array of parameters (since v1.9). * 'for_editing': true, if the settings get queried for editing; * false, if they get queried for instantiating {@link Plugin::$Settings}. * @return array see {@link Plugin::GetDefaultSettings()}. * The array to be returned should define the names of the settings as keys (max length is 30 chars) * and assign an array with the following keys to them (only 'label' is required): */ function GetDefaultSettings( & $params ) { global $app_version; return array( 'section_test_start' => array( 'layout' => 'begin_fieldset', 'label' => T_('Dynamic Settings') ), 'sample_sets' => array( 'label' => T_('Dynamic Settings'), 'note' => T_('Click to add another set'), 'type' => version_compare( $app_version, '6.6.5', '>' ) ? 'array:array:string' : 'array', 'max_count' => 10, 'entries' => array( 'disabled' => array( 'label' => T_('Disabled'), 'defaultvalue' => 0, 'type' => 'checkbox', 'note' => T_('Check to disable this something.'), ), 'sample_text' => array( 'label' => T_('Something else'), 'note' => T_('Some thing to note ').' '.sprintf( T_('E.g. «%s»'), 'FooBar' ), 'size' => 30, ), 'sample_options' => array( 'label' => $this->T_('Some options'), 'type' => 'select', 'options' => array( 'none' => $this->T_('None'), 'foo' => $this->T_('Foo'), 'bar' => $this->T_('Bar') ), 'note' => $this->T_('A note of something'), ), 'sample_checkbox' => array( 'label' => T_('Checkbox'), 'note' => T_('A Note about this checkbox'), 'type' => 'checkbox', ), 'sample_group' => array( 'label' => T_('Groups'), 'type' => 'select_group', 'note' => T_('The group note.'), 'allow_none' => true, ), ), ), 'section_test_end' => array( 'layout' => 'end_fieldset', ), ); } /** * Define the PER-USER settings of the plugin here. These can then be edited by each user. * * @see Plugin::GetDefaultSettings() * @param array Associative array of parameters. * 'for_editing': true, if the settings get queried for editing; * false, if they get queried for instantiating * @return array See {@link Plugin::GetDefaultSettings()}. */ function GetDefaultUserSettings( & $params ) { global $app_version; return array( 'section_test_start' => array( 'layout' => 'begin_fieldset', 'label' => T_('Dynamic Settings') ), 'sample_sets' => array( 'label' => T_('Dynamic Settings'), 'note' => T_('Click to add another set'), 'type' => version_compare( $app_version, '6.6.5', '>' ) ? 'array:array:string' : 'array', 'max_count' => 10, 'entries' => array( 'disabled' => array( 'label' => T_('Disabled'), 'defaultvalue' => 0, 'type' => 'checkbox', 'note' => T_('Check to disable this something.'), ), 'sample_text' => array( 'label' => T_('Something else'), 'note' => T_('Some thing to note ').' '.sprintf( T_('E.g. «%s»'), 'FooBar' ), 'size' => 30, ), 'sample_options' => array( 'label' => $this->T_('Some options'), 'type' => 'select', 'options' => array( 'none' => $this->T_('None'), 'foo' => $this->T_('Foo'), 'bar' => $this->T_('Bar') ), 'note' => $this->T_('A note of something'), ), 'sample_checkbox' => array( 'label' => T_('Checkbox'), 'note' => T_('A Note about this checkbox'), 'type' => 'checkbox', ), 'sample_group' => array( 'label' => T_('Groups'), 'type' => 'select_group', 'note' => T_('The group note.'), 'allow_none' => true, ), ), ), 'section_test_end' => array( 'layout' => 'end_fieldset', ), ); } /** * Define here default custom settings that are to be made available * in the backoffice for collections, private messages and newsletters. * * @param array Associative array of parameters. * @return array See {@link Plugin::get_custom_setting_definitions()}. */ function get_custom_setting_definitions( & $params ) { global $app_version; return array( 'section_test_start' => array( 'layout' => 'begin_fieldset', 'label' => T_('Dynamic Settings') ), 'sample_sets' => array( 'label' => T_('Dynamic Settings'), 'note' => T_('Click to add another set'), 'type' => version_compare( $app_version, '6.6.5', '>' ) ? 'array:array:string' : 'array', 'max_count' => 10, 'entries' => array( 'disabled' => array( 'label' => T_('Disabled'), 'defaultvalue' => 0, 'type' => 'checkbox', 'note' => T_('Check to disable this something.'), ), 'sample_text' => array( 'label' => T_('Something else'), 'note' => T_('Some thing to note ').' '.sprintf( T_('E.g. «%s»'), 'FooBar' ), 'size' => 30, ), 'sample_options' => array( 'label' => $this->T_('Some options'), 'type' => 'select', 'options' => array( 'none' => $this->T_('None'), 'foo' => $this->T_('Foo'), 'bar' => $this->T_('Bar') ), 'note' => $this->T_('A note of something'), ), 'sample_checkbox' => array( 'label' => T_('Checkbox'), 'note' => T_('A Note about this checkbox'), 'type' => 'checkbox', ), 'sample_group' => array( 'label' => T_('Groups'), 'type' => 'select_group', 'note' => T_('The group note.'), 'allow_none' => true, ), ), ), 'section_test_end' => array( 'layout' => 'end_fieldset', ), ); } /** * Define here default collection/blog settings that are to be made available in the backoffice. * * @param array Associative array of parameters. * @return array See {@link Plugin::get_coll_setting_definitions()}. */ function get_coll_setting_definitions( & $params ) { global $app_version; return array( 'section_test_start' => array( 'layout' => 'begin_fieldset', 'label' => T_('Dynamic Settings') ), 'sample_sets' => array( 'label' => T_('Dynamic Settings'), 'note' => T_('Click to add another set'), 'type' => version_compare( $app_version, '6.6.5', '>' ) ? 'array:array:string' : 'array', 'max_count' => 10, 'entries' => array( 'disabled' => array( 'label' => T_('Disabled'), 'defaultvalue' => 0, 'type' => 'checkbox', 'note' => T_('Check to disable this something.'), ), 'sample_text' => array( 'label' => T_('Something else'), 'note' => T_('Some thing to note ').' '.sprintf( T_('E.g. «%s»'), 'FooBar' ), 'size' => 30, ), 'sample_options' => array( 'label' => $this->T_('Some options'), 'type' => 'select', 'options' => array( 'none' => $this->T_('None'), 'foo' => $this->T_('Foo'), 'bar' => $this->T_('Bar') ), 'note' => $this->T_('A note of something'), ), 'sample_checkbox' => array( 'label' => T_('Checkbox'), 'note' => T_('A Note about this checkbox'), 'type' => 'checkbox', ), 'sample_group' => array( 'label' => T_('Groups'), 'type' => 'select_group', 'note' => T_('The group note.'), 'allow_none' => true, ), ), ), 'section_test_end' => array( 'layout' => 'end_fieldset', ), ); } /** * Param definitions when added as a widget. * * Plugins used as widget need to implement the SkinTag hook. * * @return array */ function get_widget_param_definitions( $params ) { global $app_version; return array( 'section_test_start' => array( 'layout' => 'begin_fieldset', 'label' => T_('Dynamic Settings') ), 'sample_sets' => array( 'label' => T_('Dynamic Settings'), 'note' => T_('Click to add another set'), 'type' => version_compare( $app_version, '6.6.5', '>' ) ? 'array:array:string' : 'array', 'max_count' => 10, 'entries' => array( 'disabled' => array( 'label' => T_('Disabled'), 'defaultvalue' => 0, 'type' => 'checkbox', 'note' => T_('Check to disable this something.'), ), 'sample_text' => array( 'label' => T_('Something else'), 'note' => T_('Some thing to note ').' '.sprintf( T_('E.g. «%s»'), 'FooBar' ), 'size' => 30, ), 'sample_options' => array( 'label' => $this->T_('Some options'), 'type' => 'select', 'options' => array( 'none' => $this->T_('None'), 'foo' => $this->T_('Foo'), 'bar' => $this->T_('Bar') ), 'note' => $this->T_('A note of something'), ), 'sample_checkbox' => array( 'label' => T_('Checkbox'), 'note' => T_('A Note about this checkbox'), 'type' => 'checkbox', ), 'sample_group' => array( 'label' => T_('Groups'), 'type' => 'select_group', 'note' => T_('The group note.'), 'allow_none' => true, ), ), ), 'section_test_end' => array( 'layout' => 'end_fieldset', ), ); } // If you use hooks, that are not present in b2evo 1.8, you should also add // a GetDependencies() function and require the b2evo version your Plugin needs. // See http://doc.b2evolution.net/stable/plugins/Plugin.html#methodGetDependencies // Add the methods to hook into here... // See http://doc.b2evolution.net/stable/plugins/Plugin.html function SkinTag( & $params ) { return true; } } ?>