From: Simon H. <sim...@us...> - 2010-11-02 18:07:57
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv10214/opaque/moodleModule/opaque/stack Modified Files: stackDeploy.php stackLib.php Log Message: Polishing the deployment page, including moodle category selector. Index: stackDeploy.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackDeploy.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** stackDeploy.php 1 Nov 2010 18:18:30 -0000 1.6 --- stackDeploy.php 2 Nov 2010 18:07:49 -0000 1.7 *************** *** 90,93 **** --- 90,101 ---- stackUpdateDeployment($SESSION->stackSelectedEngine, $specs); break; + + case get_string('stackDeploy_button_moveTo', 'qtype_opaque'): + $specs['id'] = $_GET['id']; // not sure this is needed but, hey. + $specs['category'] = $_POST['category']; + $specs['operation'] = 'move'; + //print_r($specs); + stackMoveDeployment($SESSION->stackSelectedEngine, $specs); + break; } } *************** *** 117,121 **** $param = $_POST + $_GET; ! $deployedPage = stackDeployedList($SESSION->stackSelectedEngine, $param); //echo '<pre>'.print_r($deployedPage, 1); --- 125,129 ---- $param = $_POST + $_GET; ! $deployedPage = stackDeployedList($SESSION->stackSelectedEngine, $param); // problem here //echo '<pre>'.print_r($deployedPage, 1); *************** *** 137,148 **** echo "<form method='POST' action='?id=".$_GET['id']."'>"; ! echo $deployedPage->xhtml; // may include form fields //echo " <input type='checkbox' name='autoprime' checked='checked'> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); //echo " <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); if($deployedList == NULL) { ! // nothing required: echo '<p>'.get_string('noInstances', 'qtype_opaque').'</p>'; } else --- 145,158 ---- echo "<form method='POST' action='?id=".$_GET['id']."'>"; ! echo "<div class='mdl-align'>".$deployedPage->xhtml."</div>"; // may include form fields //echo " <input type='checkbox' name='autoprime' checked='checked'> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); //echo " <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); + if($deployedList == NULL) { ! // nothing required: ! echo '<p class="mdl-align">'.get_string('noInstances', 'qtype_opaque').'</p>'; } else Index: stackLib.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackLib.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** stackLib.php 1 Nov 2010 18:18:30 -0000 1.21 --- stackLib.php 2 Nov 2010 18:07:49 -0000 1.22 *************** *** 533,536 **** --- 533,575 ---- } + + function stackMoveDeployment($engineID, $param) { + + $engine = load_engine_def($engineID); + if(is_string($engine)) + { + echo $engine; //error occured. + } + else + { + $connection = connect_to_engine($engine); + if (is_string($connection)) + { + echo $connection; + } + + global $USER; + $keys[] = 'userID'; + $values[] = $USER->id; + + $keys[] = 'id'; + $values[] = $param['id']; + + $passkey = stackGetPassKey($engineID, $USER->id); + + $keys[] = 'operation'; + $values[] = 'move'; + + $keys[] = 'category'; + $values[] = $param['category']; + + $keys[] = 'engineID'; + $values[] = $engineID; + + echo soap_call($connection, 'stackDeployOperation', array($passkey, $USER->id, $keys, $values)); + } + } + + /** * Returns the name of the engine from its id |