コード例 #1
0
ファイル: configure.php プロジェクト: swk/bluebox
 public function postInstall()
 {
     $tree = Doctrine::getTable('Grouping')->getTree();
     $root = new Grouping();
     $root->name = 'Root';
     $root->locked = true;
     $root->save();
     $tree->createRoot($root);
     $branches = new Grouping();
     $branches->name = "Branches";
     $branches->locked = true;
     $branches->save();
     $branches->getNode()->insertAsLastChildOf($root);
     /*	This is sample data. There is no known way to tell if a user wants to install sample data :(
             foreach (explode(" ","Albany Christchurch Ellerslie Remote") AS $name) {
                     $branch=new Grouping;
                     $branch->name=$name;
                     $branch->save();
                     $branch->getNode()->insertAsLastChildOf($branches);
             }
     	// the last branch shows whatever is happening on remotebluebox
     	$branch['plugins']=array('directory'=>array('remote'=>'http://remotebluebox/directory/xmlout'));
     	$branch->save();
         }
     */
 }
コード例 #2
0
ファイル: GroupingController.php プロジェクト: artmart/verare
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Grouping();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Grouping'])) {
         $model->attributes = $_POST['Grouping'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }