Example #1
0
function __ac_desc_show($object)
{
    global $gbl, $sgbl, $login, $ghtml;
    print_time("show_select");
    if (!$object) {
        return;
    }
    $selflist = $object->getSelfList();
    //print_time("show_select", "Show Select");
    /*
    	$list = $object->createShowShowlist();
    	if ($list) {
    		foreach($list as $k => $l) {
    			$newobject = $object->getFromList($k, "/");
    			__ac_desc_show($newobject);
    		}
    	}
    */
    $class = lget_class($object);
    $subaction = $ghtml->frm_subaction;
    if (!$login->isAdmin()) {
        check_for_license();
    }
    //dprintr($gbl->c_session->ssession_vars);
    $object->getAnyErrorMessage();
    $object->createShowPropertyList($prlist);
    if (!$prlist['property']) {
        $object->getParentO()->createShowPropertyList($prlist);
        foreach ($prlist['property'] as $k => $v) {
            $prlist['property'][$k] = "goback=1&{$v}";
        }
    }
    $ghtml->print_tab_block($prlist['property']);
    if ($sgbl->isKloxo() && $object->isLogin() && $object->isLte('reseller')) {
        print_customer_mode($object);
    }
    if ($selflist) {
        $ghtml->printShowSelectBox($selflist);
    }
    $printed_message = false;
    $clist = $object->createShowClist($subaction);
    $sclist = $object->createShowSclist();
    if ($sclist) {
        do_select_list($object, $sclist);
    }
    $ghtml->print_message();
    //if ($ilist) {
    //$ghtml->print_info_block($object, $ilist);
    //}
    $cname = $object->getClass();
    $extra = $object->getExtraId();
    $ghtml->print_information('pre', 'show', $cname, $extra, "");
    $ilist = $object->createShowInfolist($subaction);
    $rlist = $object->createShowRlist($subaction);
    $plist = $object->createShowPlist($subaction);
    $progname = $sgbl->__var_program_name;
    if (!$subaction || $subaction === 'config') {
        $class = $object->get__table();
        $var = "{$class}_show_list";
        $interf = null;
        /*
        	$ift = $login->getSpecialObject('sp_specialplay')->interface_template;
        	if ($ift && $ift !== "--$progname-default--") {
        		$iob = new interface_template(null, null, $ift);
        		$iob->get();
        		if ($iob->dbaction !== 'add' && isset($iob->$var)) {
        			$interf = $iob->$var;
        		}
        	}
        */
        $object->createShowAlist($showalist);
        $object->createShowAlistConfig($advanced);
        if (isset($showalist['__v_message'])) {
            print "<table cellpadding=16 width=100% cellspacing=0 border=0> <tr> <td align=center> ";
            print "<table cellpadding=4 width=80% cellspacing=13 border=1 height=80> <tr> <td > &nbsp; &nbsp; <img src=img/general/button/warningpic.gif> &nbsp;  {$showalist['__v_message']} </td></tr></table>";
            print "</td></tr></table>";
            unset($showalist['__v_message']);
            $printed_message = true;
            if (isset($showalist['__v_refresh'])) {
                //print("<META HTTP-EQUIV=REFRESH CONTENT=7>");
                unset($showalist['__v_refresh']);
            }
        }
        $total = lx_merge_good($showalist, $advanced);
        if ($interf) {
            foreach ($interf as $k => $v) {
                if (csb($v, "__title")) {
                    $interf[$k] = $v;
                } else {
                    $interf[$k] = base64_decode($v);
                }
            }
        }
        if (!$subaction) {
            if ($interf) {
                foreach ($interf as $k => $i) {
                    if (csb($i, "__title")) {
                        $nnalist[$i] = $total[$i];
                        continue;
                    }
                    $res = search_url_in_array($i, $total);
                    if ($res !== false) {
                        $nnalist[$res] = $total[$res];
                    }
                }
            } else {
                $nnalist = $showalist;
            }
        } else {
            if ($subaction === 'config') {
                if ($interf) {
                    foreach ($total as $k => $a) {
                        if ($ghtml->is_special_variable($a)) {
                            $u = $a->purl;
                        } else {
                            $u = $a;
                        }
                        if (csb($k, "__title")) {
                            //$nnalist[$u] = $u;
                            continue;
                        }
                        $res = search_url_in_array($u, $interf);
                        if ($res === false) {
                            $nnalist[$k] = $total[$k];
                        }
                    }
                    $nnalist = lx_merge_good(array('__title_advanced' => 'Advanced'), $nnalist);
                } else {
                    $nnalist = $advanced;
                }
            }
        }
        $aalist = $nnalist;
    }
    if (!$subaction && !$printed_message) {
        $object->createShowActionList($acalist);
        if ($acalist) {
            array_splice($aalist, 1, 0, $acalist);
        }
    }
    $nalist = null;
    if ($aalist) {
        // We need the title to be the first one. Or else the insides wont' work.
        $gottitle = false;
        foreach ($aalist as $k => $a) {
            if (csb($k, "__title")) {
                $gottitle = true;
                $nalist[$k] = $a;
                break;
            }
        }
        if (!$gottitle) {
            $nalist['__title_resource'] = 'Advanced';
            // Lighes changed Advanced to Resource
            // Changed back to Advanced
        }
        foreach ((array) $aalist as $k => $a) {
            if (csb($k, "__title")) {
                if (!$a) {
                    $a = 'Advanced';
                    // Lighes changed Advanced to Resource
                    // Changed back to Advanced
                }
                $nalist[$k] = $a;
                continue;
            }
            if (!is_array($a)) {
                $nalist[$k] = $ghtml->getFullUrl($a);
            }
        }
    }
    if (($rlist || $plist || $ilist) && !$printed_message) {
        print "<table cellpadding=0 cellspacing=0 valign=top align=left> <tr valign=top> <td  valign=top> <table cellpadding=0 cellspacing=0 valign=top> <tr valign=top> <td valign=top align=left>";
        $ghtml->print_find($object);
        if ($ilist) {
            $ghtml->printObjectTable(null, $object, 'information');
        }
        if ($object->createShowNote()) {
            $ghtml->print_note($object);
        }
        if ($rlist) {
            $ghtml->printObjectTable(null, $object, 'resource');
        }
        if ($plist) {
            $ghtml->printObjectTable(null, $object, 'permission');
        }
        print "</td> </tr> </table> <table cellpadding=0 cellspacing=0 height=650> <tr> <td > </td> </tr> </table>  </td> <td valign=top width=100%> <table cellpadding=0 cellspacing=0 width=100%> <tr> <td >";
        if (isset($nalist)) {
            $ghtml->print_object_action_block($object, $nalist, 8);
        }
        print "</td> </tr> </table> </td> </tr> </table> ";
    } else {
        if (isset($nalist)) {
            print "<table cellpadding=0 cellspacing=0 height=10> <tr> <td >  ";
            $ghtml->print_object_action_block($object, $nalist, 8);
            print "</td> </tr> </table> ";
            print "<table class=mediumtableheader width=100%> <tr> <td >  </td></tr></table> <br> ";
        }
    }
    $object->showRawPrint($subaction);
    $aflist = $object->createShowAddform();
    $uflist = $object->createShowUpdateform();
    foreach ((array) $uflist as $k => $v) {
        do_updateform($object, $k);
    }
    foreach ((array) $aflist as $k => $v) {
        do_addform($object, $k);
    }
    foreach ((array) $clist as $k => $v) {
        make_show_all($object, $k);
        do_list_class($object, $k);
    }
    $ghtml->print_information('post', 'show', $cname, $subaction, "");
}
Example #2
0
function __ac_desc_show($object)
{
    global $gbl, $sgbl, $login, $ghtml;
    print_time("show_select");
    if (!$object) {
        return;
    }
    $selflist = $object->getSelfList();
    $class = lget_class($object);
    $subaction = $ghtml->frm_subaction;
    if (!$login->isAdmin()) {
        check_for_license();
    }
    $object->getAnyErrorMessage();
    $object->createShowPropertyList($prlist);
    if (!$prlist['property']) {
        $object->getParentO()->createShowPropertyList($prlist);
        foreach ($prlist['property'] as $k => $v) {
            $prlist['property'][$k] = "goback=1&{$v}";
        }
    }
    $ghtml->print_tab_block($prlist['property']);
    if ($sgbl->isKloxo() && $object->isLogin() && $object->isLte('reseller')) {
        print_customer_mode($object);
    }
    if ($selflist) {
        $ghtml->printShowSelectBox($selflist);
    }
    $printed_message = false;
    $clist = $object->createShowClist($subaction);
    $sclist = $object->createShowSclist();
    if ($sclist) {
        do_select_list($object, $sclist);
    }
    $ghtml->print_message();
    $cname = $object->getClass();
    $extra = $object->getExtraId();
    $ghtml->print_information('pre', 'show', $cname, $extra, "");
    $ilist = $object->createShowInfolist($subaction);
    $rlist = $object->createShowRlist($subaction);
    $plist = $object->createShowPlist($subaction);
    $progname = $sgbl->__var_program_name;
    if (!$subaction || $subaction === 'config') {
        $class = $object->get__table();
        $var = "{$class}_show_list";
        $interf = null;
        $object->createShowAlist($showalist);
        $object->createShowAlistConfig($advanced);
        if (isset($showalist['__v_message'])) {
            print "<table cellpadding=16 width=100% cellspacing=0 border=0> <tr> <td align=center> ";
            print "<table cellpadding=4 width=80% cellspacing=13 border=1 height=80> <tr> <td > &nbsp; &nbsp; <img src=img/general/button/warningpic.gif> &nbsp;  {$showalist['__v_message']} </td></tr></table>";
            print "</td></tr></table>";
            unset($showalist['__v_message']);
            $printed_message = true;
            if (isset($showalist['__v_refresh'])) {
                unset($showalist['__v_refresh']);
            }
        }
        $total = lx_merge_good($showalist, $advanced);
        if ($interf) {
            foreach ($interf as $k => $v) {
                if (csb($v, "__title")) {
                    $interf[$k] = $v;
                } else {
                    $interf[$k] = base64_decode($v);
                }
            }
        }
        if (!$subaction) {
            if ($interf) {
                foreach ($interf as $k => $i) {
                    if (csb($i, "__title")) {
                        $nnalist[$i] = $total[$i];
                        continue;
                    }
                    $res = search_url_in_array($i, $total);
                    if ($res !== false) {
                        $nnalist[$res] = $total[$res];
                    }
                }
            } else {
                $nnalist = $showalist;
            }
        } else {
            if ($subaction === 'config') {
                if ($interf) {
                    foreach ($total as $k => $a) {
                        if ($ghtml->is_special_variable($a)) {
                            $u = $a->purl;
                        } else {
                            $u = $a;
                        }
                        if (csb($k, "__title")) {
                            continue;
                        }
                        $res = search_url_in_array($u, $interf);
                        if ($res === false) {
                            $nnalist[$k] = $total[$k];
                        }
                    }
                    $nnalist = lx_merge_good(array('__title_advanced' => 'advanced'), $nnalist);
                } else {
                    $nnalist = $advanced;
                }
            }
        }
        $aalist = $nnalist;
    }
    if (!$subaction && !$printed_message) {
        $object->createShowActionList($acalist);
        if ($acalist) {
            array_splice($aalist, 1, 0, $acalist);
        }
    }
    $nalist = null;
    if ($aalist) {
        // We need the title to be the first one. Or else the insides wont' work.
        $gottitle = false;
        foreach ($aalist as $k => $a) {
            if (csb($k, "__title")) {
                $gottitle = true;
                $nalist[$k] = $a;
                break;
            }
        }
        if (!$gottitle) {
            $nalist['__title_resource'] = 'General_Get__Title_Error';
        }
        foreach ((array) $aalist as $k => $a) {
            if (csb($k, "__title")) {
                if (!$a) {
                    $a = 'General_get_title_error';
                }
                $nalist[$k] = $a;
                continue;
            }
            if (!is_array($a)) {
                $nalist[$k] = $ghtml->getFullUrl($a);
            }
        }
    }
    if (($rlist || $plist || $ilist) && !$printed_message) {
        print "<!-- Main Blocks -->\n";
        print "<table cellpadding=0 cellspacing=0 valign=top align=left>\n";
        print "<tr valign=top>\n";
        print "<td valign=top>\n";
        print "<!-- Main Block Left side -->\n";
        print "<table cellpadding=0 cellspacing=0 valign=top>\n";
        print "<tr valign=top>\n";
        print "<td valign=top align=left>\n";
        print "<!-- Search Table -->\n";
        $ghtml->print_find($object);
        print "<!-- End Search Table -->\n";
        if ($ilist) {
            $ghtml->printObjectTable(null, $object, 'information');
        }
        if ($object->createShowNote()) {
            $ghtml->print_note($object);
        }
        if ($rlist) {
            $ghtml->printObjectTable(null, $object, 'resource');
        }
        if ($plist) {
            $ghtml->printObjectTable(null, $object, 'permission');
        }
        print "</td>\n";
        print "</tr>\n";
        print "</table>\n";
        print "<!-- End Main Block Table -->\n";
        //
        // This is a nice table :)
        // DT03032014
        // TODO: Do something with this empty table
        //
        print "<!-- Empty table -->\n";
        print "<table cellpadding=0 cellspacing=0 height=650>\n";
        print "<tr>\n";
        print "<td>\n";
        print "</td>\n";
        print "</tr>\n";
        print "</table>\n";
        print "<!-- End Empty table -->\n";
        print "</td>\n";
        print "<!-- End Main Block Left Side -->\n";
        print "<!-- Blocks Right Side -->\n";
        print "<td valign=top width=100%>\n";
        print "<table cellpadding=0 cellspacing=0 width=100%>\n";
        print "<tr>\n";
        print "<td>\n";
        if (isset($nalist)) {
            $ghtml->print_object_action_block($object, $nalist, 8);
        }
        print "</td>\n";
        print "</tr>\n";
        print "</table>\n";
        print "<!-- End Blocks Right Side -->\n";
        print "</td>\n";
        print "</tr>\n";
        print "</table>\n";
        print "<!-- End Main Blocks -->\n";
    } else {
        if (isset($nalist)) {
            print "<!-- Object Blocks -->\n";
            print "<table cellpadding=0 cellspacing=0 height=10> <tr> <td >  ";
            $ghtml->print_object_action_block($object, $nalist, 8);
            print "</td> </tr> </table> ";
            print "<table class=mediumtableheader width=100%> <tr> <td >  </td></tr></table> <br> ";
        }
    }
    $object->showRawPrint($subaction);
    $aflist = $object->createShowAddform();
    $uflist = $object->createShowUpdateform();
    foreach ((array) $uflist as $k => $v) {
        do_updateform($object, $k);
    }
    foreach ((array) $aflist as $k => $v) {
        do_addform($object, $k);
    }
    foreach ((array) $clist as $k => $v) {
        make_show_all($object, $k);
        do_list_class($object, $k);
    }
    print "<!-- Print Information -->\n";
    $ghtml->print_information('post', 'show', $cname, $subaction, "");
    print "<!-- PAGE END -->\n";
    print "</body>\n";
    print "</html>\n";
}