Пример #1
0
function convert_tree_to_frm_o()
{
    global $gbl, $sgbl, $login, $ghtml;
    $cid = $ghtml->node;
    if (!csa($cid, "&")) {
        return null;
    }
    $cid = trim($cid, "/&");
    $dlist = explode("&", $cid);
    $i = 0;
    $ghtml->__title_function = false;
    $ghtml->__resource_class = false;
    foreach ((array) $dlist as $d) {
        //if (csa($d, "_s_vv_p_")) {
        if (csb($d, "__title_")) {
            $ghtml->__title_function = $d;
            continue;
        }
        if (csb($d, "__resource_")) {
            $ghtml->__resource_class = $d;
            continue;
        }
        $ghtml->__resource_class = false;
        if (csa($d, "-")) {
            list($class, $name) = getClassAndName($d);
            $frmo[$i]['class'] = $class;
            $frmo[$i]['nname'] = $name;
        } else {
            $frmo[$i]['class'] = $d;
        }
        $i++;
    }
    $ghtml->__http_vars['frm_o_o'] = $frmo;
}
Пример #2
0
 function consistencyAlreadyExisting($res, $trulist, $real)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $pclname = $res[0]['parent_clname'];
     if ($pclname != $this->parent_clname) {
         list($parentclass, $parentname) = getClassAndName($pclname);
         if ($real) {
             $this->dbaction = 'already_present_under_different_owner';
         }
         if ($login->isAdmin()) {
             $parentstring = "{$parentclass}:{$parentname}";
         } else {
             $parentstring = "Someone Else";
         }
         $this->AddMEssageOnlyIfClientDomain("<font color=red><b> (Already Present under {$parentstring}. Will Not be Restored)</font> </b> ");
         if ($this->isCoreBackup()) {
             log_restore("{$this->get__table()}:{$this->nname} is already present under another user. Won't be restored");
         }
         return false;
     }
     if (isset($res[0]['syncserver']) && $this->syncserver !== $res[0]['syncserver']) {
         $string = "Server for {$this->get__table()}:{$this->nname} in the backup is {$this->syncserver} but in the database is {$res[0]['syncserver']}. Using the one in Database\n";
         $this->syncserver = $res[0]['syncserver'];
         $this->createSyncClass();
         print $string;
         log_restore($string);
     }
     $class = $this->get__table();
     $existobj = new $class($this->__masterserver, $this->syncserver, $this->nname);
     $existobj->get();
     $cl = $existobj->getChildListFilter(null);
     foreach ((array) $cl as $c) {
         if (cse($c, "_a")) {
             $this->AddToArrayObjectList($c, $existobj->{$c});
         }
     }
     if ($real) {
         if ($gbl->__var_list_flag) {
             if ($this->isCoreBackup()) {
                 print "{$this->getClName()} under {$this->__parent_o->nname} Already exists.....\n";
             }
         } else {
             $this->setUpdateSubaction('full_update');
             if ($this->isCoreBackup()) {
                 print "{$this->getClName()} under {$this->__parent_o->nname} Already exists... Updating.....\n";
             }
         }
     }
     $extra = null;
     if ($trulist) {
         $extra = " Will be Updated";
     }
     $this->AddMEssageOnlyIfClientDomain("<b> (Already Exists.{$extra}). </b>");
     if ($this->extraRestore()) {
         $sgbl->__var_objectrestorelist[] = $this;
     }
     $this->__var_checked = true;
     return true;
 }
Пример #3
0
 function getId()
 {
     list($class, $name) = getClassAndName($this->nname);
     return $name;
 }