Code

Moved snapshot tpl to ihtml/themes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jun 2006 04:05:34 +0000 (04:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jun 2006 04:05:34 +0000 (04:05 +0000)
Moved include/class_SnapShotDialog.inc into ./include

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3881 594d385d-05f5-0310-b6e9-bd551577e9d8

ihtml/themes/default/snapshotdialog.tpl [new file with mode: 0755]
include/class_SnapShotDialog.inc [new file with mode: 0755]
plugins/admin/systems/class_SnapShotDialog.inc [deleted file]
plugins/admin/systems/snapshotdialog.tpl [deleted file]

diff --git a/ihtml/themes/default/snapshotdialog.tpl b/ihtml/themes/default/snapshotdialog.tpl
new file mode 100755 (executable)
index 0000000..c71b070
--- /dev/null
@@ -0,0 +1,99 @@
+{if $RestoreMode}
+
+<h2>{t}Restoring an object snapshot{/t}</h2>
+<br>
+<p class="seperator">
+{t}This procedure will create a working snapshot of the selected object.{/t}
+<br>
+</p>
+<p class="seperator">
+<br>
+
+       {if $CountSnapShots!=0}
+               <b>{t}You will be able to restore from{/t}</b>
+       {else}
+               <b>{t}There are no available snapshots.{/t}</b>
+       {/if}
+<br>
+<br>
+</p>
+<br>
+<table summary="">
+       <tr>
+               <td>
+                       {if $CountSnapShots==0}
+                               {t}There is no snapshot available that could be restored.{/t}
+                       {else}
+                               {t}Choose a snapshot and click continue, to restore the snapshot.{/t}
+                       {/if}
+               </td>
+       </tr>
+       <tr>
+               <td>
+                       <select name="SnapShot" {if $CountSnapShots==0} disabled {/if}>
+                               {if $CountSnapShots==0} disabled 
+                                       <option value="">&nbsp;{t}none{/t}&nbsp;</option>
+                               {else}
+                                       <option value="">&nbsp;</option>
+                                       {html_options options=$SnapShots}
+                               {/if}
+                       </select>
+               </td>
+       </tr>
+</table>
+
+<p class="seperator">&nbsp;</p>
+<p>
+<div style="width:100%; text-align:right;">
+    <input type='submit' name='RestoreSnapshot' value='{t}Continue{/t}' {if $CountSnapShots==0} disabled {/if}>
+    &nbsp;
+    <input type='submit' name='CancelSnapshot' value='{t}Cancel{/t}'>
+</div></p>
+{else}
+
+<h2>{t}Creating an object snapshot{/t}</h2>
+<br>
+<p class="seperator">
+{t}This procedure will create a working snapshot of the selected object.{/t}
+<br>
+</p>
+<p class="seperator">
+<br>
+<b>{t}You will be able to restore from{/t}</b>
+<br>
+<br>
+</p>
+<br>
+<table summary="">
+       <tr>
+               <td style="width:120px;">
+                       {t}Object{/t} 
+               </td>
+               <td> 
+                  {$CurrentDN}
+               </td>
+       </tr>
+       <tr>
+               <td>
+                       {t}Date{/t} 
+               </td>
+               <td> 
+                  {$CurrentDate}
+               </td>
+       </tr>
+       <tr>
+               <td style="vertical-align:top;" colspan="2">
+                       {t}Description{/t}<br> 
+                       <textarea name="CurrentDescription" style="width:400px;height:120px;">{$CurrentDescription}</textarea>
+               </td>
+       </tr>
+</table>
+
+<p class="seperator">&nbsp;</p>
+<p>
+<div style="width:100%; text-align:right;">
+    <input type='submit' name='CreateSnapshot' value='{t}Continue{/t}'>
+    &nbsp;
+    <input type='submit' name='CancelSnapshot' value='{t}Cancel{/t}'>
+</div></p>
+{/if}
diff --git a/include/class_SnapShotDialog.inc b/include/class_SnapShotDialog.inc
new file mode 100755 (executable)
index 0000000..07b410d
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+
+/* Snap shot dialog class */
+class SnapShotDialog extends plugin 
+{
+       var $config;
+       var $attributes                 = array("CurrentDescription");
+       var $CurrentDescription = "";
+       var $parent                             = NULL;
+       var $Restore                    = false;                /* Defines the restore mode */
+       var $DeletedOnes                = false;                /* Specifies which objects will be listed */    
+       var $dialog                             = true;
+       
+       function SnapShotDialog($config,$dn,$parent)
+       {
+               plugin::plugin($config,$dn);
+               $this->parent = $parent;
+       }
+       
+       
+       /* Display snapshot dialog */
+       function execute()
+       {
+               plugin::execute();
+               $smarty = get_smarty();
+
+               /* We must restore a snapshot, so get snapshots  */
+               if($this->Restore){
+
+                       /* Should we only display all snapshots of already deleted objects 
+                or the snapshots for the given object dn */
+                       $res = array();
+                       if($this->DeletedOnes){
+                               if(is_array($this->dn)){
+                                       $tmp = array();
+                                       foreach($this->dn as $dn){
+                                               $tmp = array_merge($tmp,$this->getAllDeletedSnapshots($dn,true));
+                                       }
+                               }else{
+                                       $tmp = $this->getAllDeletedSnapshots($this->dn,true);
+                               }
+                       }else{
+                               $tmp = $this->Available_SnapsShots($this->dn,true);
+                       }
+               
+                       /* Walk through all entries and setup the display text */
+                       foreach($tmp as $key => $entry){
+                       
+                               $data = $entry['description'][0];
+                               $date = date("d.m.Y H.i.s",preg_replace("/\-.*$/","",$entry['gosaSnapshotTimestamp'][0]));
+                               if($this->DeletedOnes){
+                                       $data.= " - ".$entry['gosaSnapshotDN'][0];
+                               }
+       
+                               if(strlen($data) > 83){
+                                       $data= substr($data,0,80)." ...";
+                               }
+       
+                               $res[base64_encode($entry['dn'])] = $date." - ".$data;
+                       }
+                       natcasesort($res);
+                       $smarty->assign("SnapShots",array_reverse($res));
+                       $smarty->assign("CountSnapShots",count($res));
+               }
+
+               $smarty->assign("RestoreMode",$this->Restore);
+               $smarty->assign("CurrentDate",date("d.m.Y H:i"));
+               $smarty->assign("CurrentDN",$this->dn);
+               $smarty->assign("CurrentDescription",$this->CurrentDescription);
+               return($smarty->fetch(get_template_path("snapshotdialog.tpl",TRUE)));
+       }
+
+
+       function check()
+       {
+               $message = plugin::check();
+               if(!$this->Restore){
+                       if(empty($this->CurrentDescription)){
+                               $message[]  = _("Please specify a valid description for this snapshot.");
+                       }
+               }
+               return($message);
+       }
+
+
+       function save_object()
+       {       
+               plugin::save_object();
+               foreach($this->attributes as $name){
+                       if(isset($_POST[$name])){
+                               $this->$name = stripslashes($_POST[$name]);
+                       }
+               }
+       }
+}
+
+?>
diff --git a/plugins/admin/systems/class_SnapShotDialog.inc b/plugins/admin/systems/class_SnapShotDialog.inc
deleted file mode 100755 (executable)
index 5d9149d..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-/* Snap shot dialog class */
-class SnapShotDialog extends plugin 
-{
-       var $config;
-       var $attributes                 = array("CurrentDescription");
-       var $CurrentDescription = "";
-       var $parent                             = NULL;
-       var $Restore                    = false;                /* Defines the restore mode */
-       var $DeletedOnes                = false;                /* Specifies which objects will be listed */    
-       var $dialog                             = true;
-       
-       function SnapShotDialog($config,$dn,$parent)
-       {
-               plugin::plugin($config,$dn);
-               $this->parent = $parent;
-       }
-       
-       
-       /* Display snapshot dialog */
-       function execute()
-       {
-               plugin::execute();
-               $smarty = get_smarty();
-
-               /* We must restore a snapshot, so get snapshots  */
-               if($this->Restore){
-
-                       /* Should we only display all snapshots of already deleted objects 
-                or the snapshots for the given object dn */
-                       $res = array();
-                       if($this->DeletedOnes){
-                               if(is_array($this->dn)){
-                                       $tmp = array();
-                                       foreach($this->dn as $dn){
-                                               $tmp = array_merge($tmp,$this->getAllDeletedSnapshots($dn,true));
-                                       }
-                               }else{
-                                       $tmp = $this->getAllDeletedSnapshots($this->dn,true);
-                               }
-                       }else{
-                               $tmp = $this->Available_SnapsShots($this->dn,true);
-                       }
-               
-                       /* Walk through all entries and setup the display text */
-                       foreach($tmp as $key => $entry){
-                       
-                               $data = $entry['description'][0];
-                               $date = date("d.m.Y H.i.s",preg_replace("/\-.*$/","",$entry['gosaSnapshotTimestamp'][0]));
-                               if($this->DeletedOnes){
-                                       $data.= " - ".$entry['gosaSnapshotDN'][0];
-                               }
-       
-                               if(strlen($data) > 83){
-                                       $data= substr($data,0,80)." ...";
-                               }
-       
-                               $res[base64_encode($entry['dn'])] = $date." - ".$data;
-                       }
-                       natcasesort($res);
-                       $smarty->assign("SnapShots",array_reverse($res));
-                       $smarty->assign("CountSnapShots",count($res));
-               }
-
-               $smarty->assign("RestoreMode",$this->Restore);
-               $smarty->assign("CurrentDate",date("d.m.Y H:i"));
-               $smarty->assign("CurrentDN",$this->dn);
-               $smarty->assign("CurrentDescription",$this->CurrentDescription);
-               return($smarty->fetch(get_template_path("snapshotdialog.tpl",TRUE,dirname(__FILE__))));
-       }
-
-
-       function check()
-       {
-               $message = plugin::check();
-               if(!$this->Restore){
-                       if(empty($this->CurrentDescription)){
-                               $message[]  = _("Please specify a valid description for this snapshot.");
-                       }
-               }
-               return($message);
-       }
-
-
-       function save_object()
-       {       
-               plugin::save_object();
-               foreach($this->attributes as $name){
-                       if(isset($_POST[$name])){
-                               $this->$name = stripslashes($_POST[$name]);
-                       }
-               }
-       }
-}
-
-?>
diff --git a/plugins/admin/systems/snapshotdialog.tpl b/plugins/admin/systems/snapshotdialog.tpl
deleted file mode 100755 (executable)
index c71b070..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-{if $RestoreMode}
-
-<h2>{t}Restoring an object snapshot{/t}</h2>
-<br>
-<p class="seperator">
-{t}This procedure will create a working snapshot of the selected object.{/t}
-<br>
-</p>
-<p class="seperator">
-<br>
-
-       {if $CountSnapShots!=0}
-               <b>{t}You will be able to restore from{/t}</b>
-       {else}
-               <b>{t}There are no available snapshots.{/t}</b>
-       {/if}
-<br>
-<br>
-</p>
-<br>
-<table summary="">
-       <tr>
-               <td>
-                       {if $CountSnapShots==0}
-                               {t}There is no snapshot available that could be restored.{/t}
-                       {else}
-                               {t}Choose a snapshot and click continue, to restore the snapshot.{/t}
-                       {/if}
-               </td>
-       </tr>
-       <tr>
-               <td>
-                       <select name="SnapShot" {if $CountSnapShots==0} disabled {/if}>
-                               {if $CountSnapShots==0} disabled 
-                                       <option value="">&nbsp;{t}none{/t}&nbsp;</option>
-                               {else}
-                                       <option value="">&nbsp;</option>
-                                       {html_options options=$SnapShots}
-                               {/if}
-                       </select>
-               </td>
-       </tr>
-</table>
-
-<p class="seperator">&nbsp;</p>
-<p>
-<div style="width:100%; text-align:right;">
-    <input type='submit' name='RestoreSnapshot' value='{t}Continue{/t}' {if $CountSnapShots==0} disabled {/if}>
-    &nbsp;
-    <input type='submit' name='CancelSnapshot' value='{t}Cancel{/t}'>
-</div></p>
-{else}
-
-<h2>{t}Creating an object snapshot{/t}</h2>
-<br>
-<p class="seperator">
-{t}This procedure will create a working snapshot of the selected object.{/t}
-<br>
-</p>
-<p class="seperator">
-<br>
-<b>{t}You will be able to restore from{/t}</b>
-<br>
-<br>
-</p>
-<br>
-<table summary="">
-       <tr>
-               <td style="width:120px;">
-                       {t}Object{/t} 
-               </td>
-               <td> 
-                  {$CurrentDN}
-               </td>
-       </tr>
-       <tr>
-               <td>
-                       {t}Date{/t} 
-               </td>
-               <td> 
-                  {$CurrentDate}
-               </td>
-       </tr>
-       <tr>
-               <td style="vertical-align:top;" colspan="2">
-                       {t}Description{/t}<br> 
-                       <textarea name="CurrentDescription" style="width:400px;height:120px;">{$CurrentDescription}</textarea>
-               </td>
-       </tr>
-</table>
-
-<p class="seperator">&nbsp;</p>
-<p>
-<div style="width:100%; text-align:right;">
-    <input type='submit' name='CreateSnapshot' value='{t}Continue{/t}'>
-    &nbsp;
-    <input type='submit' name='CancelSnapshot' value='{t}Cancel{/t}'>
-</div></p>
-{/if}