-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9f3867
commit e88b1c9
Showing
8 changed files
with
153 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
# | ||
# Configuration file for ResourceSpace plugin "Sample" | ||
# | ||
# These are the default values. They can be overridden by using /plugins/sample/pages/setup.php | ||
# which is invoked by choosing Team Centre > Manage Plugins and then clicking on Options for the | ||
# sample plugin once it has been activated. | ||
|
||
# $sample_pets_owned = array(2); // Indices to the list of pets type giving types owned | ||
// 0=Cat, 1=Bird, 2=Dog, 3=Fish, 4=Horse, 5=Lizard, 6=Monkey | ||
# $sample_favorite_pet_type = 2; // Index in the list of pet types giving type of favorite pet | ||
# $sample_favorite_pet_name = ""; // Typed in text giving the name of the favorite pet | ||
# $sample_favorite_pet_living = -1; // Boolean specifying whether favorite pet is alive or not | ||
|
||
$inline_keywords_usertype = 'a'; | ||
$inline_keywords_background_colour = 'hotPink'; | ||
$inline_keywords_use_jQuery_ui = True; | ||
$inline_keywords_use_legacy_jQuery = True; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
<?php | ||
# | ||
# English Language File for the sample plugin | ||
# | ||
|
||
$lang['selectall'] = 'Select All'; | ||
$lang['unselectall'] = 'Unselect All'; | ||
$lang['addkeywords'] = 'Add Keyword(s)'; | ||
$lang['keywordstoresource'] = 'Add keyword(s) to selected resources.'; | ||
|
||
$lang['inline_keywords_heading'] = 'Inline Keywords Plugin Configuration'; | ||
$lang['inline_keywords_frontm']='This is a sample configuration page for a plugin. It doesn\'t actually modify ' . | ||
'the behavior of RS since it has no hooks, but it does show how to build a simple plugin setup page. ' . | ||
'Using this page you can set the values of the configuration variables. To do so, make the ' . | ||
'desired adjustments and click \'Save Configuration\'.'; | ||
|
||
$lang['inline_keywords_usertype'] = 'Type of user that should have access to this:'; | ||
$lang['inline_keywords_background_colour'] = 'What colour should the border of selected resource(s) be:'; | ||
$lang['inline_keywords_use_jQuery_ui'] = 'Should jQuery UI be used for notifications:'; | ||
$lang['inline_keywords_use_legacy_jQuery'] = 'Should legacy jQuery functions be used for versions of jQuery less than 1.7.x :'; | ||
|
||
|
||
$lang['no-yes'] = array('No', 'Yes'); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
# | ||
# Setup page for the sample plugin | ||
# | ||
# This page can be displayed by choosing Team Centre > Manage Plugins and clicking on Options | ||
# for the sample plugin after it has been activated. It is used to override the default values | ||
# of the plugin's configuration variables. | ||
# | ||
# In addition to this sample, there's also a template in the same directory as this file. You | ||
# may find it an easier starting point for writing a setup page for your own plugin. | ||
# | ||
|
||
// Do the include and authorization checking ritual | ||
include '../../../include/db.php'; | ||
include '../../../include/authenticate.php'; if (!checkperm('a')) {exit ($lang['error-permissiondenied']);} | ||
include '../../../include/general.php'; | ||
|
||
// Specify the name of this plugin, the heading to display for the page and the | ||
// optional introductory text. | ||
$plugin_name = 'inline_keywords'; | ||
$page_heading = $lang['inline_keywords_heading']; | ||
$page_intro = '<p>' . $lang['inline_keywords_frontm'] . '</p>'; | ||
|
||
// Build the $page_def array of descriptions of each configuration variable the sample uses. | ||
// Each element of $page_def describes one configuration variable. Each description is | ||
// created by one of the config_add_xxxx helper functions. See their definitions and | ||
// descriptions in include/plugin_functions for more information. | ||
// | ||
// The sample plugin has four configuration variables: | ||
// | ||
// 1) $inline_keywords_pets_owned is a string array variable whose values are drawn from | ||
// the indices of the array $lang['inline_keywords_pet_type_list']. For the UI the textual | ||
// description for this variable is in $lang['inline_keywords_pets_owned']. We use | ||
// config_add_multi_select() because we want a multi-select UI for this variable. | ||
// 2) $inline_keywords_favorite_pet_type is a string variable whose value is drawn from the indices | ||
// of the array $lang['inline_keywords_pet_type_list']. Its UI description is in | ||
// $lang['inline_keywords_favorite_pet_type']. We want a single-select UI. | ||
// 3) $inline_keywords_favorite_pet_name is a string variable whose value is typed by the user. | ||
// The description for the UI is in $lang['inline_keywords_favorite_pet_name'] | ||
// 4) $inline_keywords_favorite_pet_living is a boolean variable. Normally the UI for a boolean | ||
// displays the choices "False" and "True" (in the local language) but here we | ||
// specify we want it to show "No" and "Yes" (in the local language). | ||
|
||
$page_def[] = config_add_text_input('inline_keywords_usertype', $lang['inline_keywords_usertype'] ); | ||
$page_def[] = config_add_text_input('inline_keywords_background_colour', $lang['inline_keywords_background_colour']); | ||
$page_def[] = config_add_boolean_select('inline_keywords_use_legacy_jQuery',$lang['inline_keywords_use_jQuery_ui'], $lang['no-yes']); | ||
$page_def[] = config_add_boolean_select('inline_keywords_use_jQuery_ui',$lang['inline_keywords_use_jQuery_ui'], $lang['no-yes']); | ||
|
||
// Do the page generation ritual | ||
$upload_status = config_gen_setup_post($page_def, $plugin_name); | ||
include '../../../include/header.php'; | ||
config_gen_setup_html($page_def, $plugin_name, $upload_status, $page_heading, $page_intro); | ||
include '../../../include/footer.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
# | ||
# Setup page template | ||
# | ||
# You can 'crib' from this code to easily create a setup.php file for a new plugin. | ||
# | ||
|
||
// Do the include and authorization checking ritual -- don't change this section. | ||
include '../../../include/db.php'; | ||
include '../../../include/authenticate.php'; if (!checkperm('a')) {exit ($lang['error-permissiondenied']);} | ||
include '../../../include/general.php'; | ||
|
||
// Specify the name of this plugin, the heading to display for the page and the | ||
// optional introductory text. Set $page_intro to "" for no intro text | ||
// Change to match your plugin. | ||
$plugin_name = 'plugin_name_goes_here'; // Usually a string literal | ||
$page_heading = $lang['plugin_name_plugin_heading_goes_here']; // Usually a $lang[] string | ||
$page_intro = '<p>html_content_goes_here</p>'; // Usually either a $lang[] string or '' | ||
|
||
// Build the $page_def array of descriptions of each configuration variable the plugin uses. | ||
// Each element of $page_def describes one configuration variable. Each description is | ||
// created by one of the config_add_xxxx helper functions. See their definitions and | ||
// descriptions in include/plugin_functions for more information. | ||
|
||
$page_def[] = config_add_xxxx(...); | ||
$page_def[] = config_add_yyyy(....); | ||
... | ||
// Do the page generation ritual -- don't change this section. | ||
$upload_status = config_gen_setup_post($page_def, $plugin_name); | ||
include '../../../include/header.php'; | ||
config_gen_setup_html($page_def, $plugin_name, $upload_status, $page_heading, $page_intro); | ||
include '../../../include/footer.php'; |