index 83027c7dfb31307909ea6a1e6dc6f0bb4b2bccca..171ad312d99130b3a8d5beb0ca07efbd7d3adb0f 100644 (file)
class faiVariable extends plugin
{
- /* CLI vars */
- var $cli_summary = "Manage server basic objects";
- var $cli_description = "Some longer text\nfor help";
- var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
/* attribute list for save action */
var $ignore_account = TRUE;
var $base = "";
var $release = "";
var $copy_paste_mode = false;
+ var $cut_paste_mode = false;
- var $CopyPasteVars = array("SubObjects","FAIstate");
+ var $CopyPasteVars = array("SubObjects");
function faiVariable ($config, $dn= NULL)
{
/* Add new sub object */
if(isset($_POST['AddSubObject'])){
- $this->dialog= new $this->subClassName($this->config,"new");
- $this->dialog->acl = $this->acl;
+ $this->dialog = new $this->subClassName($this->config,"new");
+ $this->dialog->acl = $this->acl;
+ $this->dialog->parent = $this;
$this->is_dialog=true;
}
$var = $_POST['SubObject'][0];
$this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$var]);
$this->dialog->acl = $this->acl;
+ $this->dialog->parent = $this;
$_SESSION['objectinfo'] = $this->SubObjects[$var]['dn'];
$this->is_dialog=true;
}
$message= plugin::check();
/* If this is a new script, check if a script with this name already exists */
- if(!empty($this->release) && $this->copy_paste_mode){
+ if(!empty($this->release) && ($this->copy_paste_mode || $this->cut_paste_mode) ){
/* Check if current name is already used for fai scripts in selected release */
$dn = 'cn='.$this->cn.",ou=variables,".$this->release;
$this->handle_object_tagging($sub_dn, $this->gosaUnitTag);
}
}
+
+ /* return copy & paste dialog
+ */
+ function getCopyDialog()
+ {
+ /* Ask for cn */
+ $smarty = get_smarty();
+ $smarty->assign("cn" ,$this->cn);
+ $str = $smarty->fetch(get_template_path("paste_fai_object.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+ /* Get posted cn */
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = $_POST['cn'];
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: