Commit 485fa3e0 authored by lphuberdeau's avatar lphuberdeau

[MOD] Module profile export

parent 7282a016
......@@ -2839,6 +2839,7 @@ lib/core/Tiki/Command/ProfileExport/Finalize.php -text
lib/core/Tiki/Command/ProfileExport/Forum.php -text
lib/core/Tiki/Command/ProfileExport/IncludeProfile.php -text
lib/core/Tiki/Command/ProfileExport/Init.php -text
lib/core/Tiki/Command/ProfileExport/Module.php -text
lib/core/Tiki/Command/ProfileExport/ObjectWriter.php -text
lib/core/Tiki/Command/ProfileExport/Preference.php -text
lib/core/Tiki/Command/ProfileExport/RecentChanges.php -text
......
......@@ -82,6 +82,7 @@ if (file_exists('profiles/info.ini')) {
$console->add(new Tiki\Command\ProfileExport\Category);
$console->add(new Tiki\Command\ProfileExport\Forum);
$console->add(new Tiki\Command\ProfileExport\IncludeProfile);
$console->add(new Tiki\Command\ProfileExport\Module);
$console->add(new Tiki\Command\ProfileExport\Preference);
$console->add(new Tiki\Command\ProfileExport\RecentChanges);
$console->add(new Tiki\Command\ProfileExport\Tracker);
......
<?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
namespace Tiki\Command\ProfileExport;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Module extends ObjectWriter
{
protected function configure()
{
$this
->setName('profile:export:module')
->setDescription('Export a module definition')
->addArgument(
'module',
InputArgument::REQUIRED,
'Module ID'
)
;
parent::configure();
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$moduleId = $input->getArgument('module');
$writer = $this->getProfileWriter($input);
$result = \Tiki_Profile_InstallHandler_Module::export($writer, $moduleId);
if ($result) {
$writer->save();
} else {
$output->writeln("Module not found: $moduleId");
}
}
}
......@@ -75,4 +75,54 @@ class Tiki_Profile_InstallHandler_Module extends Tiki_Profile_InstallHandler
{
return str_replace('_modules', '', $zone_id);
}
public static function export(Tiki\Profile\Writer $writer, $moduleId)
{
$modlib = TikiLib::lib('mod');
if (! $info = $modlib->get_assigned_module($moduleId)) {
return false;
}
$spec = $modlib->get_module_info($info['name']);
TikiLib::parse_str($info['params'], $module_params);
foreach ($module_params as $param => & $value) {
if (isset($spec['params'][$param])) {
$def = $spec['params'][$param];
if (isset($def['profile_reference'])) {
$value = self::handleValueExport($writer, $def, $value);
}
}
}
$info['params'] = $module_params;
$data = array(
'name' => $info['name'],
'position' => $info['position'],
'order' => $info['ord'],
'cache' => $info['cache_time'],
'rows' => $info['rows'],
'groups' => unserialize($info['groups']),
'params' => $info['params'],
);
if ($custom = $modlib->get_user_module($info['name'])) {
$data['custom'] = $custom['data'];
$data['parse'] = $custom['parse'];
}
$writer->addObject('module', $moduleId, $data);
return true;
}
private static function handleValueExport($writer, $def, $value)
{
$value = $writer->getReference($def['profile_reference'], $value);
return $value;
}
}
......@@ -137,11 +137,7 @@ class ModLib extends TikiLib
if ($res["groups"]) {
$grps = unserialize($res["groups"]);
$res["module_groups"] = '';
foreach ($grps as $grp) {
$res["module_groups"] .= " $grp ";
}
$res["module_groups"] = implode(' ', $res['groups']);
}
return $res;
......@@ -834,6 +830,7 @@ class ModLib extends TikiLib
'section' => 'visibility',
'separator' => ';',
'filter' => 'alnum',
'profile_reference' => 'category',
),
'nocategory' => array(
'name' => tra('No Category'),
......@@ -841,6 +838,7 @@ class ModLib extends TikiLib
'section' => 'visibility',
'separator' => ';',
'filter' => 'alnum',
'profile_reference' => 'category',
),
'subtree' => array(
'name' => tra('Category subtrees'),
......@@ -854,6 +852,7 @@ class ModLib extends TikiLib
'separator' => ';',
'filter' => 'digits',
'section' => 'visibility',
'profile_reference' => 'perspective',
),
'lang' => array(
'name' => tra('Language'),
......@@ -875,6 +874,7 @@ class ModLib extends TikiLib
'separator' => ';',
'filter' => 'pagename',
'section' => 'visibility',
'profile_reference' => 'wiki_page',
),
'nopage' => array(
'name' => tra('No Page'),
......@@ -882,6 +882,7 @@ class ModLib extends TikiLib
'separator' => ';',
'filter' => 'pagename',
'section' => 'visibility',
'profile_reference' => 'wiki_page',
),
'theme' => array(
'name' => tra('Theme'),
......@@ -1370,20 +1371,7 @@ class ModLib extends TikiLib
*/
function get_user_module($name)
{
$cachelib = TikiLib::lib('cache');
$cacheKey = "user_modules_$name";
if ( $cachelib->isCached($cacheKey) ) {
$return = unserialize($cachelib->getCached($cacheKey));
} else {
$return = $this->table('tiki_user_modules')->fetchFullRow(array('name' => $name));
if ($return) {
$cachelib->cacheItem($cacheKey, serialize($return));
}
}
return $return;
return $this->table('tiki_user_modules')->fetchFullRow(array('name' => $name));
}
/**
......
......@@ -24,12 +24,13 @@ function module_article_archives_info()
'more' => array(
'name' => tra('More'),
'description' => tra('If set to "y", displays a button labelled "More..." that links to a paginated view of the selected articles.') . " " . tr('Default: "n".'),
'filter' => 'word'
'filter' => 'word',
),
'categId' => array(
'name' => tra('Category filter'),
'description' => tra('If set to a category identifier, only consider the articles in the specified category.') . " " . tra('Example value: 13.') . " " . tr('Not set by default.'),
'filter' => 'int'
'filter' => 'int',
'profile_reference' => 'category',
),
'topic' => array(
'name' => tra('Topic filter (by names)'),
......@@ -37,16 +38,17 @@ function module_article_archives_info()
),
'topicId' => array(
'name' => tra('Topic filter (by identifiers)'),
'description' => tra('If set to a list of article topic identifiers separated by plus signs, only consider the articles in the specified article topics. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles in the specified article topics are not considered.') . " " . tra('Example values: 13, !13, 1+3, !1+5+7.') . " " . tr('Not set by default.')
'description' => tra('If set to a list of article topic identifiers separated by plus signs, only consider the articles in the specified article topics. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles in the specified article topics are not considered.') . " " . tra('Example values: 13, !13, 1+3, !1+5+7.') . " " . tr('Not set by default.'),
'profile_reference' => 'article_topic',
),
'type' => array(
'name' => tra('Types filter'),
'description' => tra('If set to a list of article type names separated by plus signs, only consider the articles of the specified types. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles of the specified article types are not considered.') . " " . tra('Example values: Event, !Event, Event+Review, !Event+Classified+Article.') . " " . tr('Not set by default.')
'description' => tra('If set to a list of article type names separated by plus signs, only consider the articles of the specified types. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles of the specified article types are not considered.') . " " . tra('Example values: Event, !Event, Event+Review, !Event+Classified+Article.') . " " . tr('Not set by default.'),
),
'langfilter' => array(
'name' => tra('Language filter'),
'description' => tra('If set to a language code, only consider the articles in the specified language.') . " " . tra('Example values:') . ' en, fr.' . " " . tr('Not set by default.')
)
'description' => tra('If set to a language code, only consider the articles in the specified language.') . " " . tra('Example values:') . ' en, fr.' . " " . tr('Not set by default.'),
),
),
'common_params' => array('nonums')
);
......
......@@ -25,63 +25,65 @@ function module_articles_info()
'showpubl' => array(
'name' => tra('Show publication time'),
'description' => tra('If set to "y", article publication times are shown.') . " " . tr('Default: "n".'),
'filter' => 'word'
'filter' => 'word',
),
'showcreated' => array(
'name' => tra('Show creation time'),
'description' => tra('If set to "y", article creation times are shown.') . " " . tr('Default: "n".'),
'filter' => 'word'
'filter' => 'word',
),
'show_rating_selector' => array(
'name' => tra('Show rating selector'),
'description' => tra('If set to "y", offers the user to filter articles based on a minimum and a maximum rating.') . " " . tr('Default: "n".'),
'filter' => 'word'
'filter' => 'word',
),
'img' => array(
'name' => tra('Image width'),
'description' => tra('If set, displays an image for each article if one applies, with the given width (in pixels). The article\'s own image is used, with a fallback to the article\'s topic image.') . " " . tr('Not set by default.'),
'filter' => 'int'
'filter' => 'int',
),
'categId' => array(
'name' => tra('Category filter'),
'description' => tra('If set to a category identifier, only lists the articles in the specified category.') . " " . tra('Example value: 13.') . " " . tr('Not set by default.'),
'filter' => 'int'
'filter' => 'int',
'profile_reference' => 'category',
),
'topic' => array(
'name' => tra('Topic filter (by names)'),
'description' => tra('If set to a list of article topic names separated by plus signs, only lists the articles in the specified article topics. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles in the specified article topics are not listed.') . " " . tra('Example values:') . ' Switching to Tiki, !Switching to Tiki, Tiki upgraded to version 6+Our project is one year old, !Tiki upgraded to version 6+Our project is one year old+Mr. Jones is appointed as CEO.' . " " . tr('Not set by default.')
'description' => tra('If set to a list of article topic names separated by plus signs, only lists the articles in the specified article topics. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles in the specified article topics are not listed.') . " " . tra('Example values:') . ' Switching to Tiki, !Switching to Tiki, Tiki upgraded to version 6+Our project is one year old, !Tiki upgraded to version 6+Our project is one year old+Mr. Jones is appointed as CEO.' . " " . tr('Not set by default.'),
),
'topicId' => array(
'name' => tra('Topic filter (by identifiers)'),
'description' => tra('If set to a list of article topic identifiers separated by plus signs, only lists the articles in the specified article topics. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles in the specified article topics are not listed.') . " " . tra('Example values: 13, !13, 1+3, !1+5+7.') . " " . tra("If set to 0, will take the topicId of the article if in an article."). " " . tr('Not set by default.')
'description' => tra('If set to a list of article topic identifiers separated by plus signs, only lists the articles in the specified article topics. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles in the specified article topics are not listed.') . " " . tra('Example values: 13, !13, 1+3, !1+5+7.') . " " . tra("If set to 0, will take the topicId of the article if in an article."). " " . tr('Not set by default.'),
'profile_reference' => 'article_topic',
),
'type' => array(
'name' => tra('Types filter'),
'description' => tra('If set to a list of article type names separated by plus signs, only lists the articles of the specified types. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles of the specified article types are not listed.') . " " . tra('Example values: Event, !Event, Event+Review, !Event+Classified+Article.') . " " . tr('Not set by default.')
'description' => tra('If set to a list of article type names separated by plus signs, only lists the articles of the specified types. If the string is preceded by an exclamation mark ("!"), the effect is reversed, i.e. articles of the specified article types are not listed.') . " " . tra('Example values: Event, !Event, Event+Review, !Event+Classified+Article.') . " " . tr('Not set by default.'),
),
'langfilter' => array(
'name' => tra('Language filter'),
'description' => tra('If set to a language code, only lists the articles in the specified language.') . " " . tra('Example values:') . ' en, fr.' . " " . tr('Not set by default.')
'description' => tra('If set to a language code, only lists the articles in the specified language.') . " " . tra('Example values:') . ' en, fr.' . " " . tr('Not set by default.'),
),
'sort' => array(
'name' => tra('Sort'),
'description' => tra('Specifies how the articles should be sorted.') . " " . tra('Possible values include created and created_asc (equivalent), created_desc, author, rating, topicId, lang and title. Unless "_desc" is specified, the sort is ascending. "created" sorts on article creation date.') . ' ' . tra('Default value:') . " publishDate_desc",
'filter' => 'striptags'
'filter' => 'striptags',
),
'start' => array(
'name' => tra('Offset'),
'description' => tra('If set to an integer, offsets the articles list by the given number. For example, if the module was otherwise set to list the 10 articles most recently published, setting the offset to 10 would make the module list the 11th to 20th articles in descending order of publication time instead.') . " " . tra('Default value:') . " 0",
'filter' => 'int'
'filter' => 'int',
),
'more' => array(
'name' => tra('More'),
'description' => tra('If set to "y", displays a button labelled "More" that links to a paginated view of the selected articles.') . " " . tr('Default: "n".'),
'filter' => 'word'
'filter' => 'word',
),
'absurl' => array(
'name' => tra('Absolute URL'),
'description' => tra('If set to "y", some of the links use an absolute URL instead of a relative one. This can avoid broken links if the module is to be sent in a newsletter, for example.') . " " . tr('Default: "n".')
)
'description' => tra('If set to "y", some of the links use an absolute URL instead of a relative one. This can avoid broken links if the module is to be sent in a newsletter, for example.') . " " . tr('Default: "n".'),
),
),
'common_params' => array('nonums', 'rows')
);
......
......@@ -32,6 +32,7 @@ function module_breadcrumbs_info()
'description' => tra('Menu to take the crumb trail from.'),
'filter' => 'int',
'default' => 0,
'profile_reference' => 'menu',
),
'menuStartLevel' => array(
'name' => tra('Menu Start Level'),
......
......@@ -24,12 +24,13 @@ function module_calendar_new_info()
'params' => array(
'calIds' => array(
'name' => tra('Calendars filter'),
'description' => tra('If set to a list of calendar identifiers, restricts the events to those in the identified calendars. Identifiers are separated by vertical bars ("|"), commas (",") or colons (":"). Example values: "13", "4,7", "31:49". Not set by default.')
'description' => tra('If set to a list of calendar identifiers, restricts the events to those in the identified calendars. Identifiers are separated by vertical bars ("|"), commas (",") or colons (":"). Example values: "13", "4,7", "31:49". Not set by default.'),
'profile_reference' => 'calendar',
),
'month_delta' => array(
'name' => tra('Displayed month (relative)'),
'description' => tra('Distance in month to the month to display. A distance of -1 would display the previous month. Setting this option implies a calendar view type with a month time span. Example values: 2, 0, -2, -12.'),
'filter' => 'int'
'filter' => 'int',
),
'viewlist' => array(
'name' => tra('View type'),
......@@ -73,7 +74,7 @@ function module_calendar_new_info()
'name' => tra('View navigation bar'),
'description' => 'y|n|partial',
'filter' => 'word',
'default' => 'y'
'default' => 'y',
)
)
);
......
......@@ -25,27 +25,29 @@ function module_categories_info()
'type' => array(
'name' => tra('Object type filter'),
'description' => tra('Object type filter to apply when accessing a linked category. Example values:') . ' wiki page, article, faq, blog, image gallery, image, file gallery, tracker, trackerItem, quiz, poll, survey, sheet',
'filter' => 'striptags'
'filter' => 'striptags',
),
'deep' => array(
'name' => tra('Deep'),
'description' => tra('Show subcategories objects when accessing a linked category. Possible values: on (default), off.'),
'filter' => 'word'
'filter' => 'word',
),
'categId' => array(
'name' => tra('Category ID'),
'description' => tra('Limits displayed categories to a subtree of categories starting with the category with the given ID. Example value: 11. Default: 0 (don\'t limit display).'),
'filter' => 'int'
'filter' => 'int',
'profile_reference' => 'category',
),
'categParentIds' => array(
'name' => tra('Show these categories and their children'),
'description' => tra('Show only these categories and the immediate child categories of these in the order the parameter specifies. Example values: 3,5,6.'),
'filter' => 'striptags'
'filter' => 'striptags',
'profile_reference' => 'category',
),
'selflink' => array(
'name' => tra('Category links to a page named as the category'),
'description' => 'y|n .'.tra('If y, category links to a page named as the category'),
'filter' => 'alpha'
'filter' => 'alpha',
),
),
);
......
......@@ -25,11 +25,12 @@ function module_change_category_info()
'id' => array(
'name' => tra('Category identifier'),
'description' => tra('Changes the root of the displayed categories from default "TOP" to the category with the given identifier.') . " " . tra('Note that the root category is not displayed.') . " " . tra('Example value: 13.') . " " . tra('Defaults to 0 (root).'),
'filter' => 'int'
'filter' => 'int',
'profile_reference' => 'category',
),
'notop' => array(
'name' => tra('No top'),
'description' => tra('In non-detailed view, disallow uncategorizing. Example value: 1.') . " " . tra('Not set by default.')
'description' => tra('In non-detailed view, disallow uncategorizing. Example value: 1.') . " " . tra('Not set by default.'),
),
'path' => array(
'name' => tra('Display path'),
......
......@@ -23,25 +23,26 @@ function module_directory_last_sites_info()
'params' => array(
'absurl' => array(
'name' => tra('Absolute URL'),
'description' => tra('If set to "y", some of the links use an absolute URL instead of a relative one. This can avoid broken links if the module is to be sent in a newsletter, for example.') . " " . tr('Default: "n".')
'description' => tra('If set to "y", some of the links use an absolute URL instead of a relative one. This can avoid broken links if the module is to be sent in a newsletter, for example.') . " " . tr('Default: "n".'),
),
'categoryId' => array(
'name' => tra('Directory category identifier'),
'description' => tra('If set to a directory category identifier, only displays the sites in the specified directory category.') . " " . tr('Not set by default.')
'description' => tra('If set to a directory category identifier, only displays the sites in the specified directory category.') . " " . tr('Not set by default.'),
'profile_reference' => 'category',
),
'more' => array(
'name' => tra('More'),
'description' => tra('If set to "y", displays a button labelled "More" that links to the directory.') . " " . tr('Not set by default.')
'description' => tra('If set to "y", displays a button labelled "More" that links to the directory.') . " " . tr('Not set by default.'),
),
'desc' => array(
'name' => tra('Show description'),
'description' => tra('If set to "y", the description of the directory site appears.') . " " . tr('Default: "n".'),
'filter' => 'word'
'filter' => 'word',
),
'maxdesc' => array (
'name' => tra('Maximum length of description'),
'description' => tra('If desc = "y", use maxdesc to set the maximum length of the directory site (in characters). Leave blank to set no maximum (show the entire description).') . " " . tr('Default: blank.'),
'filter' => 'int'
'filter' => 'int',
)
),
......
......@@ -24,12 +24,12 @@ function module_directory_top_sites_info()
'desc' => array(
'name' => tra('Show description'),
'description' => tra('If set to "y", the description of the directory site appears.') . " " . tr('Default: "n".'),
'filter' => 'word'
'filter' => 'word',
),
'maxdesc' => array (
'name' => tra('Maximum length of description'),
'description' => tra('If desc = "y", use maxdesc to set the maximum length of the directory site (in characters). Leave blank to set no maximum (show the entire description).') . " " . tr('Default: blank.'),
'filter' => 'int'
'filter' => 'int',
)
),
'common_params' => array('nonums')
......
......@@ -23,12 +23,13 @@ function module_forums_last_posts_info()
'params' => array(
'topics' => array(
'name' => tra('Topics only'),
'description' => tra('If set to "y", only displays topics.') . " " . tr('Not set by default.')
'description' => tra('If set to "y", only displays topics.') . " " . tr('Not set by default.'),
),
'forumId' => array(
'name' => tra('List of forum identifiers'),
'description' => tra('If set to a list of forum identifiers, restricts the posts to those in the identified forums. Identifiers are separated by colons (":").') . " " . tra('Example values:') . '"13", "31:49". ' . tra('Not set by default.'),
'separator' => ':'
'separator' => ':',
'profile_reference' => 'forum',
),
'date' => array(
'name' => tra('Show date'),
......
......@@ -55,10 +55,11 @@ function module_freetags_most_popular_info()
),
'objectId' => array(
'required' => false,
'name' => tra('BlogId'),
'name' => tra('BlogId'),
'description' => tra('Blog Id if only blog posts selected'),
'filter' => 'int',
'default' => null,
'profile_reference' => 'blog',
),
),
'common_params' => array('rows') // This is not clean. We should use just max instead of max and rows as fallback,
......
......@@ -23,11 +23,12 @@ function module_last_blog_posts_info()
'params' => array(
'nodate' => array(
'name' => tra('No date'),
'description' => tra('If set to "y", the date of posts is not displayed in the module box.') . " " . tra('Default: "n".')
'description' => tra('If set to "y", the date of posts is not displayed in the module box.') . " " . tra('Default: "n".'),
),
'blogid' => array(
'name' => tra('Blog identifier'),
'description' => tra('If set to a blog identifier, restricts the blog posts to those in the identified blog.') . " " . tra('Example value: 13.') . " " . tra('Not set by default.')
'description' => tra('If set to a blog identifier, restricts the blog posts to those in the identified blog.') . " " . tra('Example value: 13.') . " " . tra('Not set by default.'),
'profile_reference' => 'blog',
)
),
'common_params' => array('nonums', 'rows')
......
......@@ -26,17 +26,18 @@ function module_last_category_objects_info()
'description' => tra('Identifier of the category from which objects are listed. Objects merely in child categories will not be displayed.') .
" " . tra('Example value: 13.'),
'filter' => 'int',
'required' => true
'required' => true,
'profile_reference' => 'category',
),
'maxlen' => array(
'name' => tra('Maximum length'),
'description' => tra('Maximum number of characters in object names allowed before truncating.'),
'filter' => 'int'
'filter' => 'int',
),
'type' => array(
'name' => tra('Object type filter'),
'description' => tra('Type of the objects to list. Example values:') . ' *, wiki page, article, faq, blog, image gallery, image, file gallery, tracker, trackerItem, quiz, poll, survey, sheet. ' . tra('Default value:') . ' wiki page',
'filter' => 'striptags'
'filter' => 'striptags',
)
),
'common_params' => array('rows')
......
......@@ -24,7 +24,9 @@ function module_last_files_info()
'galleryId' => array(
'name' => tra('Gallery identifiers'),
'description' => tra('If set to a set of file gallery identifiers, restricts the files to those in the identified galleries. The value is a colon-separated sequence of integers.') . " " . tra('Example value: 13, 2:13, 1:2:3:5:6.') . " " . tra('Not set by default.'),
'filter' => 'int'
'filter' => 'int',
'separator' => ':',
'profile_reference' => 'file_gallery',
),),
'common_params' => array('nonums', 'rows')
);
......@@ -39,11 +41,10 @@ function module_last_files($mod_reference, $module_params)
global $smarty;
$filegallib = TikiLib::lib('filegal');
if (isset($module_params["galleryId"])) {
if (strstr($module_params['galleryId'], ':')) {
$ranking = $filegallib->get_files(0, $mod_reference["rows"], 'created_desc', '', explode(':', $module_params['galleryId']));
} else {
$ranking = $filegallib->get_files(0, $mod_reference["rows"], 'created_desc', '', $module_params["galleryId"]);
if (is_string($module_params['galleryId'])) {
$module_params['galleryId'] = explode(':', $module_params['galleryId']);
}
$ranking = $filegallib->get_files(0, $mod_reference["rows"], 'created_desc', '', $module_params["galleryId"]);
} else {
global $prefs;
$ranking = $filegallib->get_files(0, $mod_reference["rows"], 'created_desc', '', $prefs['fgal_root_id'], false, false, false, true, false, false, false, true);
......
......@@ -24,11 +24,12 @@ function module_last_images_info()
'galleryId' => array(
'name' => tra('Gallery identifier'),
'description' => tra('If set to an image gallery identifier, restricts the images to those in the identified gallery.') . " " . tra('Example value: 13.') . " " . tra('Not set by default.'),
'filter' => 'int'
'filter' => 'int',
'profile_reference' => 'file_gallery',
),
'content' => array(
'name' => tra('Link content'),
'description' => tra('Display the links as image names or thumbnails.') . " " . tra('Possible values: "names" or "thumbnails". Default value: "names"')
'description' => tra('Display the links as image names or thumbnails.') . " " . tra('Possible values: "names" or "thumbnails". Default value: "names"'),
)
),
'common_params' => array('nonums', 'rows')
......
......@@ -23,12 +23,13 @@ function module_last_modif_events_info()
'params' => array(
'calendarId' => array(
'name' => tra('Calendar Identifier'),
'description' => tra('If set to a calendar identifier, restricts the events to those in the identified calendar.') . " " . tra('Example value: 13.') . " " . tra('Not set by default.')
'description' => tra('If set to a calendar identifier, restricts the events to those in the identified calendar.') . " " . tra('Example value: 13.') . " " . tra('Not set by default.'),
'profile_reference' => 'calendar',
),
'maxlen' => array(
'name' => tra('Maximum Length'),
'description' => tra('Maximum number of characters in event names allowed before truncating.'),
'filter' => 'int'
'filter' => 'int',
),
'nodate' => array(
'name' => tra('Hide Date'),
......
......@@ -26,7 +26,9 @@ function module_last_podcasts_info()
'required' => false,
'name' => tra('File galleries IDs'),
'description' => tra('List of IDs of file galleries of type "Podcast (Audio)". Identifiers are separated by a colon (":"). If none, all file galleries will be scanned.') . ' ' . tra('Example value:') . ' 1:3. ',
'filter' => 'int'
'filter' => 'int',
'separator' => ':',
'profile_reference' => 'file_gallery',
),
'width' => array(
'required' => false,
......@@ -54,14 +56,14 @@ function module_last_podcasts_info()
'name' => tra('Bottom Link URL Text'),
'description' => tra('Text for link if Bottom Link URL is set.'),
'default' => tra('More Podcasts'),
'filter' => 'striptags'
'filter' => 'striptags',
),
'verbose' => array(
'required' => false,
'name' => tra('Verbose'),
'description' => 'y|n ' . tra('Display description of podcast below player if "y", and on title mouseover if "n".'),
'default' => 'y',
'filter' => 'striptags'
'filter' => 'striptags',
)
)
);
......@@ -78,11 +80,10 @@ function module_last_podcasts($mod_reference, $module_params)
$filegallib = TikiLib::lib('filegal');
if (isset($module_params['galleryId'])) {
if (strstr($module_params['galleryId'], ':')) {
$mediafiles = $filegallib->get_files(0, $mod_reference["rows"], 'created_desc', '', explode(':', $module_params['galleryId']));
} else {
$mediafiles = $filegallib->get_files(0, $mod_reference["rows"], 'created_desc', '', $module_params['galleryId']);
if (is_string($module_params['galleryId'])) {
$module_params['galleryId'] = explode(':', $module_params['galleryId']);
}
$mediafiles = $filegallib->get_files(0, $mod_reference["rows"], 'created_desc', '', $module_params['galleryId']);
} else {
$mediafiles = $filegallib->list_files(0, $mod_reference["rows"], 'created_desc', '');
}
......
......@@ -24,12 +24,14 @@ function module_last_tracker_comments_info()
'trackerId' => array(
'name' => tra('Tracker identifier'),
'description' => tra('If set to a tracker identifier, only displays the comments on the given tracker.') . " " . tra('Example value: 13.') . " " . tr('Not set by default.'),
'filter' => 'int'
'filter' => 'int',
'profile_reference' => 'tracker',
),
'itemId' => array(
'name' => tra('Item identifier'),
'description' => tra('If set to an item identifier, only displays the comments on the given item.') . " " . tra('Example value: 13.') . " " . tr('Not set by default.'),
'filter' => 'int'
'filter' => 'int',
'profile_reference' => 'tracker_item',
)
),
'common_params' => array('rows', 'nonums')
......
......@@ -25,27 +25,29 @@ function module_last_tracker_items_info()
'name' => tra('Tracker identifier'),
'description' => tra('Identifier of the tracker from which items are listed.') . " " . tra('Example value: 13.'),
'filter' => 'int',
'required' => true
'required' => true,
'profile_reference' => 'tracker',
),
'fieldId' => array(
'name' => tra('Field identifier'),
'description' => tra('Identifier of the field from which values are listed. If Field name is set, this parameter is ignored.') . " " . tra('Example value: 13.'),
'filter' => 'int'
'filter' => 'int',
'profile_reference' => 'tracker_field',
),
'name' => array(
'name' => tra('Field name'),
'description' => tra('Name of the field from which values are listed.') . " " . tra('Example value: age.'),
'filter' => 'striptags'
'filter' => 'striptags',
),
'sort_mode' => array(
'name' => tra('Sort'),
'description' => tra('Specifies how the items should be sorted.') . " " . tra('Possible values include created and created_asc (equivalent), created_desc, status, lastModif, createdBy and lastModifBy. Unless "_desc" is specified, the sort is ascending. "created" sorts on item creation date. "lastModif" sorts on the last modification date of items. "lastModif_desc" sorts in descending order of last modification date.') . ' ' . tra('Default value:') . " created_desc",
'filter' => 'striptags'
'filter' => 'striptags',
),
'status' => array(
'name' => tra('Status filter'),
'description' => tra('If set, limits the listed items to those with the given statuses. Values are combinations of "o" (open), "p" (pending) and "c" (closed). Possible values:') . ' opc, oc, op, pc, o, p or c. ' . tra('Default value:') . ' opc',
'filter' => 'word'
'filter' => 'word',
)
),
'common_params' => array('rows', 'nonums')
......
......@@ -25,12 +25,13 @@ function module_last_validated_faq_questions_info()
'faqId' => array(
'name' => tra('Faq identifier'),
'description' => tra('If set to a faq identifier, restricts the chosen questions to those in the identified faq.') . " " . tra('Example value: 13.') . " " . tra('Not set by default.'),
'filter' => 'int'
'profile_reference' => 'faq',
'filter' => 'int',
),
'truncate' => array(
'name' => tra('Number of characters to display'),
'description' => tra('Number of characters to display'),
'filter' => 'int'
'filter' => 'int',
),
),
'common_params' => array('nonums', 'rows')
......
......@@ -26,6 +26,7 @@ function module_map_edit_features_info()
'description' => tr('Tracker to store the feature in.'),
'required' => true,
'filter' => 'digits',
'profile_reference' => 'tracker',
),