summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 996cdf3)
raw | patch | inline | side by side (parent: 996cdf3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 26 Jun 2006 04:05:34 +0000 (04:05 +0000) | ||
committer | hickert <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
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] | patch | blob |
include/class_SnapShotDialog.inc | [new file with mode: 0755] | patch | blob |
plugins/admin/systems/class_SnapShotDialog.inc | [deleted file] | patch | blob | history |
plugins/admin/systems/snapshotdialog.tpl | [deleted file] | patch | blob | history |
diff --git a/ihtml/themes/default/snapshotdialog.tpl b/ihtml/themes/default/snapshotdialog.tpl
--- /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=""> {t}none{/t} </option>
+ {else}
+ <option value=""> </option>
+ {html_options options=$SnapShots}
+ {/if}
+ </select>
+ </td>
+ </tr>
+</table>
+
+<p class="seperator"> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='RestoreSnapshot' value='{t}Continue{/t}' {if $CountSnapShots==0} disabled {/if}>
+
+ <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"> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='CreateSnapshot' value='{t}Continue{/t}'>
+
+ <input type='submit' name='CancelSnapshot' value='{t}Cancel{/t}'>
+</div></p>
+{/if}
diff --git a/include/class_SnapShotDialog.inc b/include/class_SnapShotDialog.inc
--- /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
+++ /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
+++ /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=""> {t}none{/t} </option>
- {else}
- <option value=""> </option>
- {html_options options=$SnapShots}
- {/if}
- </select>
- </td>
- </tr>
-</table>
-
-<p class="seperator"> </p>
-<p>
-<div style="width:100%; text-align:right;">
- <input type='submit' name='RestoreSnapshot' value='{t}Continue{/t}' {if $CountSnapShots==0} disabled {/if}>
-
- <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"> </p>
-<p>
-<div style="width:100%; text-align:right;">
- <input type='submit' name='CreateSnapshot' value='{t}Continue{/t}'>
-
- <input type='submit' name='CancelSnapshot' value='{t}Cancel{/t}'>
-</div></p>
-{/if}