summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 867729d)
raw | patch | inline | side by side (parent: 867729d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 7 Oct 2010 05:51:12 +0000 (05:51 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 7 Oct 2010 05:51:12 +0000 (05:51 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19926 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc | patch | blob | history | |
gosa-plugins/goto/admin/systems/goto/Config/puppet.tpl | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc
index fcc4eb36ff4338b6292c440cf338fbf5e3ae2e0b..8985cb935a44148f92a6ba7097f4fceae6af7c05 100644 (file)
private $rootItemID;
private $lastItemID = 1;
+ private $rpcError = FALSE;
+ private $initFailed = FALSE;
+
// Some plugin related memebers which are not member of
// the management class. See class plugin.
+ public $initTime;
public $is_account = FALSE;
public $ignore_account = FALSE;
public $pl_notify;
public $read_only;
+ public $allItemConfigurations = NULL;
/*! \brief Constructs the device configuration plugin
* @param Config The GOsa configuration object.
// Set storage points - We do not have any - We just create a fake list which lists all items
$this->storagePoints = array("");
+
+ // Try to initialize
+ $this->init();
+ }
+
+
+ function setInstallMethod($str)
+ {
+ if(!isset($this->allItemConfigurations[$str])){
+ trigger_error("Invalid install method '{$str}'!");
+ }else{
+ $this->itemConfig = $this->allItemConfigurations[$str]['items'];
+ }
+ }
+
+
+ function init()
+ {
+ // Reset erros
+ $this->rpcError = $this->initFailed = FALSE;
- // CREATE Dummy entry
- $str = file_get_contents('/home/hickert/json.txt');
- $items = json_decode($str, TRUE);
+ // Load configuration via rpc.
+ $rpc = $this->config->getRpcHandle();
- // Load the item-configuration description to populate the
- // the available modules.
- $this->itemConfig = $items['items'];
+ // Populate install methods on success.
+ $res = $rpc->getSupportedInstallMethods();
+ if(!$rpc->success() || TRUE){
+ $this->rpcError = TRUE;
+ return;
+ }
+ $this->allItemConfigurations = $res;
+ if(!count($this->allItemConfigurations)){
+ msg_dialog::display(_("Setup"), _("No selectable install methods returned!", ERROR_DIALOG));
+ $this->initFailed = TRUE;
+ return;
+ }
+
+ // As default select the first entry
+ $this->setInstallMethod(key($this->allItemConfigurations));
+
+ // Load the template
$this->TemplateEngine->load($this->itemConfig);
// Detect root item, its name is /
*/
function renderList()
{
+
+ echo "<h3>Hier weiter machen, was passiert wenn init oder rpc fehlschlägt.</h3>";
+
+ // In case of an error abort here.
+ if($this->rpcError){
+ $smarty = get_smarty();
+ $smarty->assign('initFailed', $this->initFailed);
+ $smarty->assign('rpcError', $this->rpcError);
+ return($smarty->fetch(get_template_path('goto/Config/failed.tpl', TRUE)));
+ }
+
// Do we represent a valid account
if (!$this->is_account){
$str = "<img alt=\"\" src=\"images/small-error.png\" align=\"middle\"> <b>".
*/
function save_object()
{
+ // Do nothing else in case of an error
+ if($this->rpcError || $this->initFailed) return;
+
// Add sub-module requested.
if(isset($_POST['addSubModule']) && isset($_POST['subModule'])){
$sub = get_post('subModule');
// Inject user actions
function detectPostActions()
{
+ if($this->rpcError || $this->initFailed) return(array('action' => ''));
+
$action = management::detectPostActions();
if(isset($_POST['saveItemEdit'])) $action['action'] = "saveItemChanges";
if(isset($_POST['saveItemAdd'])) $action['action'] = "saveItemAdd";
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/puppet.tpl b/gosa-plugins/goto/admin/systems/goto/Config/puppet.tpl
index ac9eee73acaa777fcf246d7b2b3d7f1cc127dd73..8b8d95b5672d2e23c35bd5dcd25c28125440bc9e 100644 (file)
</td>
</tr>
</table>
- <hr>
- {$checkboxName}
- {$checkbox}
-
- <hr>
- {$comboboxName}
- {$combobox}
-
- <hr>
- {$textEditorName}<br>
- {$textEditor}
-
- <hr>
- {$fixedListName}<br>
- {$fixedList}
{/if}
{if $type == 'PuppetTemplate'}
<table>