Ejemplo n.º 1
0
    function printSelectObjectTable($name_list, $parent, $class, $blist = array(), $display = null)
    {
        global $gbl, $sgbl, $login, $ghtml;
        print_time("{$class}.objecttable");
        if ($this->frm_accountselect !== null) {
            $sellist = explode(',', $this->frm_accountselect);
        } else {
            $sellist = null;
        }
        $classdesc = $this->get_class_description($class, $display);
        $unique_name = trim($parent->nname) . trim($class) . trim($display) . trim($classdesc[2]);
        $unique_name = fix_nname_to_be_variable($unique_name);
        $filtername = $parent->getFilterVariableForThis($class);
        $fil = $this->frm_hpfilter;
        $sortdir = null;
        $sortby = null;
        if (isset($fil[$filtername]['sortby'])) {
            $sortby = $fil[$filtername]['sortby'];
        }
        if (isset($fil[$filtername]['sortdir'])) {
            $sortdir = $fil[$filtername]['sortdir'];
        }
        $pagesize = '99999';
        $iconpath = get_image_path() . "/button";
        $nlcount = count($name_list) + 1;
        $imgheadleft = $login->getSkinDir() . "/top_lt.gif";
        $imgheadleft2 = $login->getSkinDir() . "/top_lt.gif";
        $imgheadright = $login->getSkinDir() . "/top_rt.gif";
        $imgheadbg = $login->getSkinDir() . "/top_bg.gif";
        $imgbtnbg = $login->getSkinDir() . "/btn_bg.gif";
        $imgtablerowhead = $login->getSkinDir() . "/tablerow_head.gif";
        $imgtablerowheadselect = $login->getSkinDir() . "/top_line_medium.gif";
        $imgbtncrv = $login->getSkinDir() . "/btn_crv.gif";
        $imgtopline = $login->getSkinDir() . "/top_line.gif";
        $classdesc = $this->get_class_description($class);
        $unique_name = trim($parent->nname) . trim($class) . trim($classdesc[2]);
        $unique_name = fix_nname_to_be_variable($unique_name);
        //dprint("-- ".$unique_name. " --", 2);
        ?>
<br />
      <script> var ckcount<?php 
        echo $unique_name;
        ?>
 ; </script>
<?php 
        $tsortby = $sortby;
        if (!$sortby) {
            $tsortby = exec_class_method($class, "defaultSort");
        }
        if (!$sortdir) {
            $sortdir = exec_class_method($class, "defaultSortDir");
        }
        //print_time("objecttable");
        $obj_list = $parent->getVirtualList($class, $total_num, $tsortby, $sortdir);
        //print_time("objecttable", 'objecttable');
        if (!$sellist) {
            //$total_num = $this->display_count($obj_list, $display) ;
        }
        ?>

    <table width=100%> <tr> <td align=center>
    <table cellspacing=2 cellpadding=2 width=97% align=center>
    <tr><td class=rowpoint></td><td colspan= <?php 
        echo $nlcount;
        ?>
>
    <table cellpadding=0 cellspacing=0 border=0 width=100%>
    <tr><td valign=bottom ></td>
    <td>
    <?php 
        if (isset($ghtml->__http_vars['frm_hpfilter'][$filtername]['pagenum'])) {
            $cgi_pagenum = $ghtml->__http_vars['frm_hpfilter'][$filtername]['pagenum'];
        } else {
            $cgi_pagenum = 1;
        }
        if (!$sellist) {
            $this->print_next_previous($parent, $class, "top", $cgi_pagenum, $total_num, $pagesize);
        }
        ?>
    </td>
    <td align=right valign=bottom >

    <?php 
        if (!$sellist) {
            ?>
            <table cellpadding="0" cellspacing="0" border="0" height="27" >

            <tr><td><img src="<?php 
            echo $imgheadleft;
            ?>
"></td><td nowrap valign=middle background="<?php 
            echo $imgheadbg;
            ?>
"><b><font color="#ffffff"><?php 
            echo get_plural($classdesc[2]);
            ?>
 under <?php 
            echo $parent->display("nname");
            ?>
 </b> <?php 
            echo $this->print_machine($parent);
            ?>
 <b>  (<?php 
            echo $total_num;
            ?>
)</b></font></td><td><img src="<?php 
            echo $imgheadright;
            ?>
"></td></tr>
            </table>
            </td>
            </tr>

            <tr><td colspan=3><table cellpadding=0 cellspacing=0 border=0 width=100% height=35 background="<?php 
            echo $imgbtnbg;
            ?>
">
            <tr><td><img src="<?php 
            echo $imgbtncrv;
            ?>
"></td><td width=80% align=left > <table width=100% cellpadding=0 cellspacing=0 border=0><tr><td valign=bottom><?php 
            $this->print_list_submit($class, $blist, $unique_name);
            ?>
</td></tr></table></td><td width=15% align=right><b><font color="#ffffff"><?php 
            $this->print_search($parent, $class);
            ?>
</font></b></td></tr>
            </table>
            </td></tr>
    </td></tr><tr><td height=2 colspan=2></td></tr></table>

        <?php 
        } else {
            $descr = $this->getActionDescr($_SERVER['PHP_SELF'], $this->__http_vars, $class, $var, $identity);
            ?>
<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td width=70% valign=bottom><table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td width=100% height=2 background="<?php 
            echo $imgtopline;
            ?>
"></td></tr></table></td><td align=right><table cellpadding=0 cellspacing=0 border=0 width=100% ><tr><td><img src="<?php 
            echo $imgheadleft;
            ?>
"></td><td nowrap width=100% background="<?php 
            echo $imgheadbg;
            ?>
" ><b><font color="#ffffff">  Confirm <?php 
            echo $descr[1];
            ?>
:  </b><?php 
            echo get_plural($classdesc[2]);
            ?>
 from <?php 
            echo $parent->display("nname");
            ?>
</font></td><td><img src="<?php 
            echo $imgheadright;
            ?>
"></td></tr></table></td></tr></table>

    </td></tr><tr><td height=0 colspan=2></td></tr></table>

        <?php 
        }
        ?>

<!--    </td></tr><tr><td height=2 colspan=2></td></tr></table> -->
    <tr><td bgcolor="#ffffff"></td>
 <?php 
        $imguparrow = get_general_image_path() . "/button/uparrow.gif";
        $imgdownarrow = get_general_image_path() . "/button/downarrow.gif";
        foreach ($name_list as $name => $width) {
            $desc = "__desc_{$name}";
            $descr[$name] = get_classvar_description($class, $desc);
            if (!$descr[$name]) {
                print "Cannot access static variable {$class}::{$desc}";
                exit(0);
            }
            if (csa($descr[$name][2], ':')) {
                $_tlist = explode(':', $descr[$name][2]);
                $descr[$name][2] = $_tlist[0];
            }
            foreach ($descr[$name] as &$d) {
                if ($this->is_special_url($d)) {
                    continue;
                }
                if (strstr($d, "%v") !== false) {
                    $d = str_replace("[%v]", $classdesc[2], $d);
                }
            }
            if ($width === "100%") {
                $wrapstr = "wrap";
            } else {
                $wrapstr = "nowrap";
            }
            if ($sortby && $sortby === $name) {
                $wrapstr .= " background={$imgtablerowheadselect}";
                print "<td width={$width} {$wrapstr} ><table cellpadding=0 cellspacing=0 border=0> <tr> <td rowspan=2 {$wrapstr}>";
            } else {
                $wrapstr .= " background={$imgtablerowhead}";
                print "<td width={$width} {$wrapstr} class=col>";
            }
            ?>
        <b><?php 
            $this->print_sortby($parent, $class, $unique_name, $name, $descr[$name]);
            ?>
 </b></font>

        <?php 
            $imgarrow = $sortdir === "desc" ? $imgdownarrow : $imguparrow;
            if ($sortby && $sortby === $name) {
                print "</td> <td width=15><img src=" . $imgarrow . " ></td><td ></td></tr></table>";
            }
            ?>
 </td>

 <?php 
        }
        $count = 0;
        $rowcount = 0;
        ?>
    <td width=10 background=<?php 
        echo $imgtablerowhead;
        ?>
 >   <form name="formselectall<?php 
        echo $unique_name;
        ?>
" value=hello> <input type=checkbox name="selectall<?php 
        echo $unique_name;
        ?>
" value=on <?php 
        if ($sellist) {
            echo "checked disabled";
        }
        ?>
 onclick="javascript:calljselectall<?php 
        echo $unique_name;
        ?>
 ()"></form> </td>
    <?php 
        print "</tr> ";
        print_time('loop');
        $n = 1;
        foreach ((array) $obj_list as $okey => $obj) {
            $checked = '';
            // Fix This.
            if ($sellist) {
                $checked = "checked disabled";
                if (!array_search_bool($obj->nname, $sellist)) {
                    continue;
                }
            }
            $imgpointer = get_general_image_path() . "/button/pointer.gif";
            $imgblank = get_general_image_path() . "/button/blank.gif";
            ?>

        <script> loadImage('<?php 
            echo $imgpointer;
            ?>
') </script>
        <script> loadImage('<?php 
            echo $imgblank;
            ?>
') </script>

            <tr id=tr<?php 
            echo $unique_name . $rowcount;
            ?>
 class=tablerow<?php 
            echo $count;
            ?>
 onmouseover=" swapImage('imgpoint<?php 
            echo $rowcount;
            ?>
','','<?php 
            echo $imgpointer;
            ?>
',1);" onmouseout="swapImgRestore();">
        <td id=td<?php 
            echo $unique_name . $rowcount;
            ?>
 width=5 class=rowpoint><img name=imgpoint<?php 
            echo $rowcount;
            ?>
 src="<?php 
            echo $imgblank;
            ?>
"></td>
        <?php 
            $colcount = 1;
            foreach ($name_list as $name => $width) {
                $this->printObjectElement($parent, $class, $classdesc, $obj, $name, $width, $descr, $colcount . "_" . $rowcount);
                $colcount++;
            }
            $basename = basename($obj->nname);
            $selectshowbase = $this->frm_selectshowbase;
            // issue #609
            //      $ret = strfrom($parent->nname, $selectshowbase);
            $ret = str_replace('//', '/', strfrom($parent->nname, $selectshowbase));
            print " <td width=10 >";
            print "<a class=button href=\"javascript:callSetSelectFolder('/{$ret}/{$basename}')\">";
            print " Select </a>";
            print "</tr> ";
            if ($count === 0) {
                $count = 1;
            } else {
                $count = 0;
            }
            $rowcount++;
            if (!$sellist) {
                if ($n === $pagesize * $cgi_pagenum) {
                    break;
                }
            }
            $n++;
        }
        print_time('loop', "loop{$n}");
        print "<tr><td></td><td colspan={$nlcount}>";
        if (!$rowcount) {
            if ($ghtml->frm_searchstring) {
                ?>
            <table width=95%> <tr align=center> <td width=100%> <b>  No Matches Found  </b> </td> </tr> </table>
            <?php 
            } else {
                ?>
            <table width=95%> <tr align=center> <td width=100%> <b>  No <?php 
                echo get_plural($classdesc[2]);
                ?>
  under <?php 
                echo $parent->nname;
                ?>
   </b> </td> </tr> </table>
            <?php 
            }
        }
        print "</td></tr>";
        print "<tr><td class=rowpoint></td><td colspan=" . $nlcount . " >\n    <table cellpadding=0 cellspacing=0 border=0 width=100%>\n    <tr height=1 style='background:url({$imgtopline})'><td></td></tr>\n    <tr><td>";
        ?>
<script>ckcount<?php 
        echo $unique_name;
        ?>
 = <?php 
        echo $rowcount . ";  ";
        ?>
function calljselectall<?php 
        echo $unique_name;
        ?>
(){
    jselectall(document.formselectall<?php 
        echo $unique_name;
        ?>
.selectall<?php 
        echo $unique_name;
        ?>
,ckcount<?php 
        echo $unique_name;
        ?>
,'<?php 
        echo $unique_name;
        ?>
')
}
</script>


<?php 
        print "<table> <tr> <td >";
        print "<a class=button href=\"javascript:window.close()\"> Cancel </a> &nbsp; &nbsp;  ";
        print "</td> <td width=30> &nbsp; </td> <td >";
        print "</td> </tr> </table> ";
        print "</td></tr></table></tr></table></td> </tr> </table>";
        //else {
        //
        //      $this->print_list_submit($blist);
        //  }
        //print_time("$class.objecttable", "$class.objecttable");
        /// Important. This is to make sure that the session saving etc doesn't take place. We just need a plain and clean window without any saving. If this happens the current url gets added to the sessiona and redirection will screw up.
        exit;
    }
Ejemplo n.º 2
0
    function print_search($parent, $class)
    {
        global $gbl, $sgbl, $login;
        $url = $_SERVER['PHP_SELF'];
        $gen_image_path = get_general_image_path();
        $btnpath = $gen_image_path . "/icon/";
        $filtername = $parent->getFilterVariableForThis($class);
        $blackstyle = null;
        if ($sgbl->isBlackBackground()) {
            $blackstyle = "style='background:black;color:gray;border:1px solid gray;'";
        }
        $value = null;
        if ($login->issetHpFilter($filtername, 'searchstring')) {
            $value = $login->getHPFilter($filtername, 'searchstring');
        }
        $showallimg = "{$btnpath}/showall_b.gif";
        $searchimg = "{$btnpath}/search_b.gif";
        if ($sgbl->isBlackBackground()) {
            $showallimg = null;
            $searchimg = null;
        }
        ?>
		<table width=90% border=0 cellpadding=0> <tr> <td >
		<table width=100% cellpadding=0 cellspacing=0 border=0>
       	<tr><td width=60%>
		</td><td height=22 width=40% align=right>
		<table cellpadding=0 cellspacing=0 border=0 width=200><tr><td width=10 height=22></td><td height=22>
		<form name=lpform_search method=<?php 
        echo $sgbl->method;
        ?>
  action=<?php 
        echo $url;
        ?>
 onsubmit="return checksearch(this,1);">

		<?php 
        $this->print_current_input_var_unset_filter($filtername, array('sortby', 'sortdir', 'pagenum'));
        ?>
		<?php 
        $this->print_current_input_vars(array("frm_hpfilter"));
        ?>
 

		<input <?php 
        echo $blackstyle;
        ?>
 type="text" name='frm_hpfilter[<?php 
        echo $filtername;
        ?>
][searchstring]' value="<?php 
        echo $value;
        ?>
" class=searchbox size="18"></td><td width=10 height=22></td></form><td height=22 width=20><a href='javascript:document.lpform_search.submit()'><img border=0 alt="Search" title="Search"  name=search src=<?php 
        echo $searchimg;
        ?>
 height=15 width=15  onMouseOver="changeContent('help','search');"  onMouseOut="changeContent('help','helparea');"></a></form></td> <td width=10 height=22> </td><td height=22 width=70>
	<form name=lpform_showall method=<?php 
        echo $sgbl->method;
        ?>
  action=<?php 
        echo $url;
        ?>
>

		<?php 
        $this->print_current_input_vars(array("frm_hpfilter"));
        ?>
 
		<input type=hidden name=frm_clear_filter value=true>
		
		<table cellpadding=0 cellspacing=0 border=0 width=100% height=22><tr><td height=22 width=31% align=center nowrap><a href="javascript:document.lpform_showall.submit();"><img alt="Show All" title="Show all" name=showall src="<?php 
        echo $showallimg;
        ?>
"  onMouseOver="changeContent('help','showall');"  onMouseOut="changeContent('help','helparea');"  ></a></td><td width=69% height=22 nowrap><a href="javascript:document.lpform_showall.submit();" onMouseOver="changeContent('help','showall');"  onMouseOut="changeContent('help','helparea');"><font class=small>Show All</font></a></td></tr></table></td></form></tr></table></td>
</tr></table>

  </td> </tr> </table> 

		<?php 
    }