summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3103018)
raw | patch | inline | side by side (parent: 3103018)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 6 Aug 2007 07:09:57 +0000 (07:09 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 6 Aug 2007 07:09:57 +0000 (07:09 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6963 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_divlist.inc | patch | blob | history | |
plugins/admin/fai/class_faiScript.inc | patch | blob | history | |
plugins/admin/fai/faiScript.tpl | patch | blob | history |
index cd12a5ebdf206bce265b25f4900e6dc206bd33eb..2c28bc7cfa37525ec75cbddcefd96ffaff19c502 100644 (file)
$this->i_currentPage = 0;
$this->i_entriesPerPage = 10;
$this->s_height = "450";
- $this->s_width = "600";
+ $this->s_width = "600px";
$this->s_summary = "";
$this->a_entries = array();
$this->a_header = array();
function SetWidth($s_width) {
$this->s_width= $s_width;
+ if(preg_match("/^[0-9]*$/",$this->s_width)){
+ $this->s_width .="px";
+ }
}
function SetEntriesPerPage($i_num){
$s_return = "";
if(!$this->force_height){
$s_return.= "<table summary='".$this->s_summary."' style='width:".
- $this->s_width."px;height:".$this->s_height.
+ $this->s_width.";height:".$this->s_height.
"px;' cellspacing='0' id='t_scrolltable'>";
} else {
$s_return.= "<table summary='".$this->s_summary."' style='width:".
- $this->s_width."px;height:".$this->s_height.
+ $this->s_width.";height:".$this->s_height.
"px;' cellspacing='0' id='t_scrolltable_onlywidth'>";
}
// Using scrolltable?
if($this->i_entriesPerPage == 0) {
if(!$this->force_height) {
- $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:".$this->s_width."px;' cellspacing='0' id='t_scrollhead'>";
+ $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:".$this->s_width.";' cellspacing='0' id='t_scrollhead'>";
} else {
- $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:".$this->s_width."px;' cellspacing='0' id='t_scrollhead_onlywidth'>";
+ $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:".$this->s_width.";' cellspacing='0' id='t_scrollhead_onlywidth'>";
}
}
if($this->i_entriesPerPage == 0) {
// We need to construct a "body"-table that is width-of-scrollbar thinner than the "head"-table.
if(!$this->force_height) {
- $s_return .= "\n<tr><td colspan='".$this->cols."' class='scrollbody'><div style='width:".$this->s_width."px;height:".($this->s_height-20)."px;' id='d_scrollbody' class='scrollbody'>";
+ $s_return .= "\n<tr><td colspan='".$this->cols."' class='scrollbody'><div style='width:".$this->s_width.";height:".($this->s_height-20)."px;' id='d_scrollbody' class='scrollbody'>";
$s_return .= "<table summary='' style='height:100%;width:581px;' cellspacing='0' id='t_scrollbody'>";
} else {
- $s_return .= "\n<tr><td colspan='".$this->cols."' class='scrollbody'><div style='width:".$this->s_width."px;height:".($this->s_height-20)."px;' id='d_scrollbody_onlywidth' class='scrollbody'>";
+ $s_return .= "\n<tr><td colspan='".$this->cols."' class='scrollbody'><div style='width:".$this->s_width.";height:".($this->s_height-20)."px;' id='d_scrollbody_onlywidth' class='scrollbody'>";
$s_return .= "<table summary='' style='height:100%;width:581px;' cellspacing='0' id='t_scrollbody_onlywidth'>";
}
}
index 72f2d200960839c07a626ddff540f3ac68a8d5e3..cdefc192922144b83ae456ebf663c3feae93d540 100644 (file)
var $dialog = NULL; // a dialog, e.g. new disk dialog
var $SubObjects = array(); // All leafobjects of this object
- var $FAIstate ="";
+ var $FAIstate = "";
+ var $sort_by = "name";
+ var $sort_order = "up";
var $view_logged = FALSE;
var $ui;
/* Sort entries */
$tmp = $keys = array();
- foreach($this->SubObjects as $key => $entry){
- $keys[$key]=$key;
+
+ if($this->sort_by == "name"){
+ foreach($this->SubObjects as $key => $entry){
+ $keys[$key]=$entry['cn'];
+ }
+ }elseif($this->sort_by == "priority"){
+ foreach($this->SubObjects as $key => $entry){
+ $keys[$key]=$entry['FAIpriority'];
+ }
}
+
natcasesort($keys);
- foreach($keys as $key){
+
+ if($this->sort_order == "down"){
+ $keys =array_reverse($keys);
+ }
+
+ foreach($keys as $key => $order_var){
$tmp[$key]=$this->SubObjects[$key];
}
$this->SubObjects = $tmp;
/* Divlist added 23.02.2006
Containing FAIscripts
*/
- $divlist = new divSelectBox("FAIscripts");
- $divlist->setHeight(400);
+ $divlist = new divlist("FAIscripts");
+ $plug = $_GET['plug'];
+
+ $divlist->SetHeader(array( array("string"=>"<a href='?plug=".$plug."&sort=name'>"._("Name")."</a>"),
+ array("string"=>"<a href='?plug=".$plug."&sort=priority'>"._("Priority")."</a>"),
+ array("string"=>_("Download")),
+ array("string"=>_("Action"))));
+ $divlist->SetHeight(300);
+ $divlist->SetWidth("100%");
foreach($this->getList(true) as $key => $name){
$dn= $this->acl_base_for_current_object($name['dn']);
$s_acl = $this->ui->get_permissions($dn,"fai/faiScriptEntry","cn") ;
if(preg_match("/r/",$s_acl)){
$divlist->AddEntry(array( array("string"=>$name['name']),
+ array("string"=>$name['FAIpriority'] , "attach" => "style='width:20px;'"),
array("string"=>$down , "attach" => "style='width:20px;'"),
array("string"=>str_replace("%s",base64_encode($key),$act),
"attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));
$a_return[$obj['cn']]['name']= $obj['cn'];
}
$a_return[$obj['cn']]['dn']= $obj['dn'];
+ $a_return[$obj['cn']]['FAIpriority']= $obj['FAIpriority'];
}else{
if((isset($obj['description']))&&(!empty($obj['description']))){
$a_return[$obj['cn']]= $obj['cn']." [".stripslashes($obj['description'])."]";
}
}
}
+
+ /* Get sort order */
+ if(isset($_GET['sort']) && in_array($_GET['sort'],array("name","priority"))){
+ if($this->sort_by == $_GET['sort']){
+ if($this->sort_order == "up"){
+ $this->sort_order = "down";
+ }elseif($this->sort_order == "down"){
+ $this->sort_order = "up";
+ }
+ }
+ $this->sort_by = $_GET['sort'];
+ }
}
index acb0d135c69a8910866afaa0c13ae163c292ee31..093e8b5f76df2132bca228a5478c32ba47fabc9b 100644 (file)
<tr>
<td>
<h2><img class="center" alt="" src="images/fai_script.png" align="middle" title="{t}Objects{/t}">
- <LABEL for="SubObject">
{t}List of scripts{/t}
- </LABEL>
</h2>
<table width="100%" summary="">
<tr>