summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9149ddd)
raw | patch | inline | side by side (parent: 9149ddd)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 1 Oct 2010 13:46:18 +0000 (13:46 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 1 Oct 2010 13:46:18 +0000 (13:46 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19885 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc | patch | blob | history | |
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_list.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc
index 03a2a075ab90dda4441211609df6e28d380cde80..4e8a19342644131c38bb92d0890bc36b4f5cce87 100644 (file)
}
+ /*! \brief Removes a given item ID.
+ * @param String The 'id' of the item we want to remove.
+ * @return
+ */
+ function removeItem($id, &$data = NULL)
+ {
+ if($data === NULL){
+ $data = &$this->allConfiguredItems;
+ }
+
+ // Remove the item and its children
+ if(isset($data[$id])){
+ foreach($data[$id]['children'] as $cid => $item){
+ $this->removeItem($cid, $data);
+ }
+ unset($data[$id]);
+ }
+
+ // Remove to current id from sub entries
+ foreach($data as $key => $item){
+ $this->removeItem($id, $data[$key]['children']);
+ }
+ }
+
+
+ /*! \brief Initiate item edit.
+ * An action send from the management list.
+ * @param See management::editEntry
+ * @return
+ */
function editEntry($action="",$target=array(),$all=array(),
$altTabClass ="", $altTabType = "", $altAclCategory="")
{
}
+ /*! \brief Save changes for the currently edited item.
+ */
function saveItemChanges()
{
// Save eventually changed values
}
+ /*! \brief React on open requests from the management list
+ */
function openEntry($action="",$target=array(),$all=array(),
$altTabClass ="", $altTabType = "", $altAclCategory="")
{
}
+ /*! \brief Saves newly created items and adds them as child to
+ * the currently selected item.
+ */
function saveItemAdd()
{
if(!$this->dialogObject instanceOf AddItemDialog) return;
*/
function save_object()
{
- if($this->dialogObject){
- $this->TemplateEngine->save_object();
- }
-
// Add sub-module requested.
if(isset($_POST['addSubModule']) && isset($_POST['subModule'])){
$sub = get_post('subModule');
$this->setSelectedListItemID($id);
}
-
+
+ /* \brief Updates the currenlty seleted item in the management list
+ */
function setSelectedListItemID($id)
{
$this->base = $this->mappingBaseToID[$id];
}
- function removeItem($id, &$data = NULL)
- {
- if($data === NULL){
- $data = &$this->allConfiguredItems;
- }
-
- // Remove the item and its children
- if(isset($data[$id])){
- foreach($data[$id]['children'] as $cid => $item){
- $this->removeItem($cid, $data);
- }
- unset($data[$id]);
- }
-
- // Remove to current id from sub entries
- foreach($data as $key => $item){
- $this->removeItem($id, $data[$key]['children']);
- }
- }
-
-
// Inject user actions
function detectPostActions()
{
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_list.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateWidget_list.inc
index 0d21145d8422da581de5b5d65717667489030c96..358fed7aae2734299ecd947f2d593eb13becdbf8 100644 (file)
if(isset($_POST["{$this->postName}_Add"]) && isset($_POST["{$this->postName}_Input"])){
$input = get_post("{$this->postName}_Input");
- $this->value[] = $input;
+
+ if(!empty($input) && !empty($this->syntax) && !preg_match("/".$this->syntax."/", $input)){
+ msg_dialog::displayChecks(array(msgPool::invalid($this->display, $input, "/".$this->syntax."/")));
+ }elseif(!empty($input)){
+ $this->value[] = $input;
+ }
+ }
+ }
+
+ /*! \brief Check the value entry using the provieded syntax.
+ * @return Array Returns a list of errors
+ */
+ function check()
+ {
+ if($this->required && empty($this->value)){
+ return(array(msgPool::required($this->display)));
}
+ return(array());
}
}