コード例 #1
0
ファイル: Dev.php プロジェクト: Bagelllama/delphinium
 public function getDevConfigOptions()
 {
     $instances = Configuration::where("Enabled", "=", "1")->get();
     $array_dropdown = ['0' => '- select dev Config - '];
     foreach ($instances as $instance) {
         $array_dropdown[$instance->id] = $instance->Configuration_name;
     }
     return $array_dropdown;
 }
コード例 #2
0
ファイル: routes.php プロジェクト: Bagelllama/delphinium
function init($course_id)
{
    if (!isset($_SESSION)) {
        session_start();
    }
    $prettyprint = \Input::get('prettyprint');
    $source = new DataSource(isset($prettyprint) ? $prettyprint : false);
    $config = Configuration::where('Enabled', '=', '1')->first();
    $_SESSION['userID'] = $config->User_id;
    $_SESSION['userToken'] = \Crypt::encrypt($config->Token);
    $_SESSION['courseID'] = $course_id;
    $_SESSION['domain'] = $config->Domain;
    $_SESSION['lms'] = $config->Lms;
    return $source;
}
コード例 #3
0
 /**
  * Delete checked configuration instances.
  */
 public function index_onDelete()
 {
     if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {
         foreach ($checkedIds as $configId) {
             if (!($config = ConfigModel::find($configId))) {
                 continue;
             }
             $config->delete();
         }
         Flash::success("Successfully deleted");
     } else {
         Flash::error("An error occurred when trying to delete this item");
     }
     return $this->listRefresh();
 }