summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 319592d)
raw | patch | inline | side by side (parent: 319592d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Mar 2010 07:49:36 +0000 (07:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Mar 2010 07:49:36 +0000 (07:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16362 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_filterEditor.inc | patch | blob | history |
index 0cafbb480c3dba09c52e8e3627eb598c9c0ced5a..521eab71cd7d3bda99a4dcac48e5f26df596e6af 100644 (file)
public $attributes = array('gosaUserDefinedFilter');
public $gosaUserDefinedFilter = array();
-
+
+ /*! \brief Initiates the filter editing dialog.
+ */
function __construct($config, $categories)
{
-
// Initialize this plugin with the users dn to gather user defined filters.
$ui = get_userinfo();
plugin::plugin($config, $ui->dn);
}
}
+ // Create the filter list
$this->filterWidget= new sortableListing();
$this->filterWidget->setDeleteable(true);
$this->filterWidget->setEditable(true);
$this->filterWidget->setWidth("100%");
- $this->filterWidget->setHeight("70px");
+ $this->filterWidget->setHeight("270px");
$this->filterWidget->setColspecs(array('100px', '200px', '100px', '70px','150px'));
$this->filterWidget->setAcl($ui->get_permissions($ui->dn,'users/user','gosaUserDefinedFilter'));
$this->filterWidget->setListData($this->filters, $this->convertFilterList());
}
+
+ /*! \brief Converts the list of filters ($this->filters) into data which is useable
+ * for the sortableList object ($this->filterWidget).
+ * @return Array An array containg data useable for sortableLists ($this->filterWidget)
+ */
function convertFilterList()
{
$data = array();
return($data);
}
+
+ /*! \brief Display the user-filter overview as HTML content.
+ * @return string HTML-content showing the user-filter editing dialog.
+ */
function execute()
{
plugin::execute();
- // Close edit dialog
+ // Cancel filter modifications (edit dialog)
if(isset($_POST['cancelFilterSettings'])){
$this->dialog = NULL;
}
- // Close edit dialog
+ // Save modified filter entries (edit dialog)
if(isset($_POST['saveFilterSettings']) && $this->dialog instanceOf filterEditEntry){
$this->dialog->save_object();
$msgs = $this->dialog->check();
}
}
- // Act add requests
+ // Act on new requests
if(isset($_POST['addFilter'])){
$this->dialog=new filterEditEntry(array(), $this->availableCategories);
}
return($this->dialog->execute());
}
-
$smarty = get_smarty();
$smarty->assign("list", $this->filterWidget->render());
return($smarty->fetch(get_template_path('filterEditor.tpl', FALSE)));
}
- function enabled()
- {
- return(count($this->_parent->categories) != 0);
- }
-
- function save_object()
- {
-
- }
+ /*! \brief Write user-filter modifications back to the ldap.
+ */
function save()
{
+ // Build up new list of filters
$attrs = array();
foreach($this->filters as $filter){
$tmp = implode(',', $filter['categories']).";";
$attrs[] = $tmp;
}
$this->gosaUserDefinedFilter = $attrs;
+
plugin::save();
$ldap = $this->config->get_ldap_link();
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MODIFY, get_class()));
}
}
+
+
+ /*! \brief Do not save any posted values here.
+ */
+ function save_object(){}
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: