summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5fa9fb9)
raw | patch | inline | side by side (parent: 5fa9fb9)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Oct 2010 07:17:01 +0000 (07:17 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Oct 2010 07:17:01 +0000 (07:17 +0000) |
-Added pid to be able to differentiate between multiple baseSelectors
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20145 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20145 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/html/autocomplete.php | patch | blob | history | |
gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc | patch | blob | history |
index 79d9f5a22333d9f9cdae1e7441038ee11de63df5..9256a69ca1d31428a42d53b16ca5fcd1136b00e4 100644 (file)
}
/* Base completition or filter completition? */
-if (isset($_GET['type']) && $_GET['type'] == "base") {
-
+if (isset($_GET['type']) && $_GET['type'] == "base" && isset($_GET['pid'])) {
+
// Find dn based on name and description
- if (session::is_set("pathMapping") && count($_POST) == 1) {
+ $pid = $_GET['pid'];
+ if (session::is_set("pathMapping_{$pid}") && count($_POST) == 1) {
$res= "";
- $pathMapping= session::get("pathMapping");
- $department_info= session::get("department_info");
+ $pathMapping= session::get("pathMapping_{$pid}");
+ $department_info= session::get("department_info_{$pid}");
+
$search= preg_replace('/"/', '"', current($_POST));
foreach ($department_info as $dn => $info) {
+
if (!isset($pathMapping[$dn])) {
+
+
continue;
}
if (mb_stristr($info['name'], $search) !== false) {
- $res.= "<li>".mark($search, $pathMapping[$dn]).($info['description']==''?"":"<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>";
+ $res.= "<li>".mark($search, $pathMapping[$dn]).($info['description']==''?""
+ :"<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>";
continue;
}
if (mb_stristr($info['description'], $search) !== false) {
- $res.= "<li>".mark($search, $pathMapping[$dn]).($info['description']==''?"":"<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>";
+ $res.= "<li>".mark($search, $pathMapping[$dn]).($info['description']==''?""
+ :"<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>";
continue;
}
if (mb_stristr($pathMapping[$dn], $search) !== false) {
- $res.= "<li>".mark($search, $pathMapping[$dn]).($info['description']==''?"":"<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>";
+ $res.= "<li>".mark($search, $pathMapping[$dn]).($info['description']==''?""
+ :"<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>";
continue;
}
}
diff --git a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc
index 34ec9dba2e955c14b09d0113b1f34a04d216677e..3e932d53c78ea6ff05e1884534f1157452bf2620 100644 (file)
<?php
+/*! \brief This class allows to manage backend config items and packages.
+ */
class newConfigManagement extends plugin
{
var $initTime;
}
+ /*! \brief Load extended sub-objecte like 'config items' or 'packages'
+ * for the given release path.
+ * @param String The release path to load sub-objects for.
+ * @return NULL
+ */
function updateItemList($path)
{
// Fist get Item and check if it is an release
sprintf(_("Failed to load distributions, error was '%s'!"),
$rpc->get_error()),ERROR_DIALOG);
}else{
- $this->dataModel->setItemStatus($path, 'käse');
$rpc = $this->config->getRpcHandle();
$res = $rpc->getPackages($data['name']);
return;
foreach($res as $itemPath => $type){
-
+
// Make names dataModel conform
$itemPath = $path.'/'.preg_replace("/^\//","/root", $itemPath);
$name = preg_replace("/^.*\//","",$itemPath);
$itemPath = preg_replace("/\/[^\/]*$/","", $itemPath);
$this->dataModel->addItem($type, $itemPath, $name);
}
+ $this->dataModel->setItemStatus($path, 'fetched');
}
}
}
}
-
+ /*! \brief Sets the currently selected container and item path.
+ * @param String The path of the container to set.
+ * @param String The path of the item to set.
+ * @return
+ */
function setCurrentContainer($cont, $item)
{
$this->selectedContainer = $cont;
$this->selectedItem = $item;
- // Get a list of all available distributions and releases.
- $distList = $this->getDistList();
+ // Get a list of all available container and items.
+ $distList = $this->getContainerList();
$releaseList = $this->getItemList();
// Ensure that we've valid values selected.
if(!isset($releaseList[$this->selectedItem])){
if(count($releaseList)){
+ echo "Fallback";
$this->selectedItem = key($releaseList);
}else{
+ echo "Fallback 2";
$this->selectedItem = "";
}
}
// Transfer checked values back to the listing class.
$this->listing->setContainer($this->selectedContainer);
$this->listing->setItem($this->selectedItem);
- $this->listing->setContainers($this->getDistList());
+ $this->listing->setContainers($this->getContainerList());
$this->listing->setItems($this->getItemList());
}
return($res);
}
-
+
+ /*! \brief Returns a list of items which will then be displayed
+ * in the management-list.
+ * (The management class calls this method from its execute())
+ * @return Array A list of items/objects for the listing.
+ */
function getItemsToBeDisplayed()
{
function getItemList()
{
$data = $this->dataModel->getItemByPath($this->selectedContainer);
- $res = array(""=>"/");
+ $res = array();
+ $res[""]=array("name" => "/", "desc" => "ROOT");
+ $res["/root"]= array("name" => "root", "desc" => "TIMMAY");
+# $res["/root/test"]="test";
+# $res["/root/test/timmay"]="tim";
+# $res["/ad"]= "ad";
+ return($res);
+
+
if($data['type'] != 'Release'){
}else{
$res = array_merge($res,$this->__recurseItem($data, array('Component'),$this->selectedContainer));
}
return($res);
}
-
-
+
+
/*! \brief Returns a simply list of all distributions.
* This list will then be used to generate the entries of the
* ItemSelectors in the listing class.
*/
- function getDistList()
+ function getContainerList()
{
$data = $this->dataModel->getItemByPath('/root');
$res["/root"] = "/";
$res = array_merge($res,$this->__recurseItem($data, array('Distribution','Release')));
return($res);
}
-
+
+ /*! \brief Recursivly walks through an item and collects all path and name info.
+ * The reult can then be used to fill the ItemSelector.
+ * @param Array The Item to recurse.
+ * @param Array The type of of objects to collect.
+ * @param String The parent path prefix which should be removed.
+ * @return Array An array containing Array[path] = name
+ */
function __recurseItem($item, $types, $parent = "")
{
$res = array();
}
-
- function remove_lock()
- {
- }
-
-
/*! \brief Intializes this plugin
* All available installation methods will be loaded
*/
}
+ /*! \brief Returns a info list about all items we can manage,
+ * this used to fill the listings <objectType> settings.
+ * @return Array An array with item info.
+ */
function getListingTypes()
{
$types= array();
}
+ /*! \brief Acts on edit requests and opens an edit dialog for the received item-id.
+ * (This action is received from the ConfigManagementListing class.)
+ * @param Array The items ids. (May contain multiple ids)
+ * @return
+ */
function editEntry($ids)
{
foreach($ids as $id){
}
+ /*! \brief Acts on remove requests.
+ * (This action is received from the ConfigManagementListing class.)
+ * @param Array The items ids. (May contain multiple ids)
+ * @return
+ */
function removeEntry($ids)
{
foreach($ids as $id){
}
+ /*! \brief Acts on open requests.
+ * (This action is received from the ConfigManagementListing class.)
+ * @param Array The items ids. (May contain multiple ids)
+ * @return
+ */
function openEntry($ids)
{
$id = $ids[0];
$item = $this->dataModel->getItemById($id);
if($item){
if(in_array($item['type'], array('Distribution', 'Release'))){
- $this->setCurrentContainer($item['path'], $this->selectedContainer);
+ $this->setCurrentContainer($item['path'], $this->selectedItem);
+ }elseif(in_array($item['type'], array('Component'))){
+ $next = preg_replace("/".preg_quote($this->selectedContainer,'/')."/","", $item['path']);
+ $this->setCurrentContainer($this->selectedContainer, $next);
}else{
$this->editEntry(array($id));
}
}
+ /*! \brief The plugins ACL and plugin-property definition.
+ * @return
+ */
public static function plInfo()
{
return (array(
"plProvidedAcls"=> array()
));
}
+
+
+ /*! \brief
+ * @param
+ * @return
+ */
+ function remove_lock()
+ {
+ }
+
+
}
?>