Skip to content
Browse files

added configuration options for tag's list

  • Loading branch information...
1 parent 3de0a28 commit e16f3861659894257c392f255dddf622db17d160 @fizyk committed Apr 4, 2011
Showing with 22 additions and 6 deletions.
  1. +4 −0 README.markdown
  2. +5 −1 config/app.yml
  3. +12 −5 modules/fzTag/lib/BasefzTagActions.class.php
  4. +1 −0 package.xml.tmpl
View
4 README.markdown
@@ -102,6 +102,10 @@ Here are settings for fcbkcomplete script that can be set for tagging per app ba
maxshownitems: 30 # maximum numbers that will be shown at drop-down list (less better performance)
maxitems: # maximum item that can be added to the list
firstselected: false # automatically select first element from drop-down
+ list_max_tags: 10 # number of tags shown on a list
+ list_sort_default: # default list order
+ by: name
+ order: asc
Unlike in dmTagPlugin, the *complete_text* parameter is configured through i18n string.
View
6 config/app.yml
@@ -10,4 +10,8 @@ all:
filter_hide: false # show/hide filtered items
maxshownitems: 30 # maximum numbers that will be shown at dropdown list (less better performance)
maxitems: 10 # maximum item that can be added to the list
- firstselected: false # automaticly select first element from dropdown
+ firstselected: false # automaticly select first element from dropdown
+ list_max_tags: 10 # number of tags shown on a list
+ list_sort_default: # default list order
+ by: name
+ order: asc
View
17 modules/fzTag/lib/BasefzTagActions.class.php
@@ -8,10 +8,17 @@ class BasefzTagActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
- $this->sortParameters = array(
- 'by' => 'name',
- 'order' => 'asc'
- );
+ $defaultSorters = sfConfig::get('app_fzTagPlugin_list_sort_default', array());
+
+ if( !is_array($defaultSorters) or !array_key_exists(array('by', 'order'), $defaultSorters) )
+ {
+ $defaultSorters = array(
+ 'by' => 'name',
+ 'order' => 'asc'
+ );
+ }
+ $this->sortParameters = $defaultSorters;
+
if( $request->hasParameter('by') )
{
$this->sortParameters['by'] = strip_tags( $request->getParameter('by') );
@@ -22,7 +29,7 @@ public function executeIndex(sfWebRequest $request)
}
$query = fzTagTable::getInstance()->getListQuery( $this->sortParameters );
- $this->pager = new sfDoctrinePager('fzTag', 10);
+ $this->pager = new sfDoctrinePager('fzTag', sfConfig::get('app_fzTagPlugin_list_max_tags', 10));
$this->pager->setQuery($query);
$this->pager->setPage($request->getParameter( 'page', 1 ));
$this->pager->init();
View
1 package.xml.tmpl
@@ -56,6 +56,7 @@
<date>##CURRENT_DATE##</date>
<license>MIT</license>
<notes>
+ * fizyk: added configuration options for tag's list
* fizyk: added translations to frontend tag's list action
</notes>
</release>

0 comments on commit e16f386

Please sign in to comment.
Something went wrong with that request. Please try again.