public function __construct($view, $model, $locale, $conf, $base)
 {
     if (request::isPost() && $model->validatePost()) {
         $paths = array('bootstrap.php', 'conf.php', 'conf\\dev.php', 'conf\\prod.php', 'conf\\stage.php', 'controller.php', 'iModel.php', 'model.php', 'controller\\about.php', 'locale.php', 'locale\\en_US.php', 'locale\\en_US\\error.php', 'locale\\en_US\\label.php', 'locale\\en_US\\tip.php', 'model\\about.php');
         $this->copyStructure(dirname(__DIR__) . '\\resource\\repo\\myAppOne', dirname(dirname(__DIR__)) . '\\' . request::get('appTitle'));
         $this->overiteNamespace(dirname(dirname(__DIR__)), $paths, 'myAppOne', request::get('appTitle'));
         $this->overiteNamespacex(dirname(dirname(__DIR__)), array('index.php'), 'installer', request::get('appTitle'));
     }
 }
Beispiel #2
0
 public function __construct($view, $model, $locale, $conf, $base)
 {
     if (request::isPost() && $model->validatePost()) {
         $base = dir::trim(__DIR__, 0, 2, '\\', true);
         $src = dir::trim(__DIR__, 0, 1, '\\', true);
         $dst = dir::trim(__DIR__, null, 2, '\\', false, true) . request::get('appTitle');
         dir::copy($src, $dst);
         \lib\string::replaceInFile($base, array('../index.php', 'bootstrap.php', 'conf.php', 'conf\\dev.php', 'conf\\prod.php', 'controller.php', 'imodel.php', 'model.php', 'controller\\about.php', 'locale.php', 'locale\\us.php', 'locale\\us\\error.php', 'locale\\us\\label.php', 'locale\\us\\tip.php', 'locale\\us\\phrase.php', 'model\\about.php'), 'appfarm', request::get('appTitle'));
     }
 }
Beispiel #3
0
 public function __construct($view, $model, $lang, $conf)
 {
     \bootstrap::iniControllerParams($this, $view);
     if (request::isGet() && $model->validateBefore()) {
         $pages = new pdo\select('page');
         $pages->setColumns(array('page.id', 'page.sequence', 'page.uri', 'page.label', 'page.title', 'page.heading', 'page.description', 'page.content', 'page.icon', 'page.dateCreated', 'page.dateUpdated', 'page.isActive', 'p.id AS parentPageId', 'p.uri AS uriParent', 'p.label AS parentPageTitle'))->addJoin('p', 'id', 'parentId', 'LEFT', true, 'page')->addWhere('page.id', '=', request::get('id'))->execute('fetch');
         $view->editData = $pages->data;
     }
     $page = new pdo\select('page');
     $page->setColumns(array('*'))->addWhere('parentId', '=', 0)->addWhere('isActive', '=', 1)->addWhere('uri', '!=', 'about')->orderBy('page.sequence', 'asc')->count()->execute();
     $view->navItems = $page->data;
     $page = new pdo\select('page');
     $page->setColumns(array('
         page.id, 
         page.uri, 
         page.label, 
         page.title, 
         page.description, 
         page.content'))->addJoin('page_role', 'pageId', 'id', 'RIGHT')->addWhere('uri', '=', 'add')->addWhere('page_role.roleId', '=', session::get('roleId'))->execute('fetch');
     $view->page = $page->data;
     $page = new pdo\select('page');
     $page->setColumns(array('
         id, 
         label'))->orderBy('sequence', 'asc')->execute()->asList('id', 'label');
     $view->lookupPageParent = $page->data;
     if (request::isPost()) {
         if ($model->validateAfter()) {
             $data = array('parentId' => request::get('parentId'), 'sequence' => request::get('sequence'), 'uri' => request::get('uri'), 'label' => request::get('label'), 'title' => request::get('title'), 'heading' => request::get('heading'), 'description' => request::get('description'), 'icon' => request::get('icon'), 'content' => request::get('content'), 'dateUpdated' => date('Y-m-d H:i:s'));
             $page = new pdo\insert('page');
             $page->setColumns(array_keys($data))->setValues(array_values($data))->execute();
             $view->data = $data;
         } else {
             $view->errors = $model->getErrors();
         }
     }
     $navSub = new pdo\select('page');
     $navSub->setColumns(array('
         page.id, 
         page.uri, 
         page.label, 
         page.title, 
         page.icon, 
         page.description, 
         page.content,
         p.id AS parentPageId,
         p.uri AS uriParent,
         p.label AS parentPageTitle'))->addJoin('p', 'id', 'parentId', 'LEFT', true, 'page')->addJoin('page_role', 'pageId', 'id', 'RIGHT')->addWhere('page_role.isNav', '=', 1)->addWhere('page_role.roleId', '=', session::get('roleId'))->orderBy('page.sequence', 'asc')->execute();
     // echo '<pre>';
     //print_r($navSub->data);
     //die('kj');
     $view->navSub = $navSub->data;
 }
Beispiel #4
0
 public function __construct()
 {
     $this->locale = \bootstrap::getInstance('locale');
     request::load();
 }
?>
</a>
			<div class="nav-collapse collapse bs-navbar-collapse">
				<?php 
echo tpl::out('header', array('navItems' => $navMain));
?>
			</div>
		</div>
	</div>
    <div class="container canvas" style="margin-top: 100px">
	            <form class="form-horizontal" method="post">
                <div class="control-group">
                    <label class="control-label" for="inputEmail">Application Title</label>
                        <div class="controls">
                        <input type="text" name="appTitle" placeholder="Application Title" value="<?php 
echo request::get('appTitle');
?>
">
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <button type="submit" class="btn">Create</button>
                    </div>
                </div>
            </form>
    </div>
        
        <footer class="muted">
            <?php 
echo tpl::out('footer');
 /**
  * Set root title (first node name)
  *
  * @param $value string.
  * @return void
  */
 public function validatePost()
 {
     request::load();
     $this->setValue('appTitle', (string) request::get('appTitle'))->blank($this->locale->error->blank->replace('__name', 'Application Title'));
     return $this->isPass();
 }
Beispiel #7
0
 /**
  * Set root title (first node name)
  *
  * @param $value string.
  * @return void
  */
 public function validatePost()
 {
     $this->setValue('appTitle', (string) request::get('appTitle'))->blank('Application Title cannot be blank')->alpha('Application Title must consits of alphabetical characters')->lengthMax('Application Title must not exceed 25 characters', 25)->lengthMin('Application Title cannot be less than 3 characters', 3)->callback('application ' . request::get('appTitle') . ' already exists', $this, 'isApplicationDuplicate');
     return $this->isPass();
 }
Beispiel #8
0
    ?>
">Enter Application</a>
                        </div>
                    <?php 
}
?>
                    <label class="control-label" for="apptitle">Small caps, no spaces, no special chars.</label>
                    <p class="text-muted text-right">
                        <?php 
echo $locale->label->example->capitalize();
?>
 <span class="label label-info">myapplication</span>
                    </p>
                   
                    <?php 
echo htmltag::text(array('id' => 'apptitle', 'class' => 'form-control', 'name' => 'appTitle', 'placeholder' => 'Application Title', 'value' => request::get('appTitle'), 'maxlength' => 25, 'required' => 'required'));
?>
                </div>
                
                <?php 
echo htmltag::button(array('type' => 'submit', 'data-placement' => 'bottom', 'title' => $locale->label->create->capitalize() . ' ' . $locale->label->application->capitalize(), 'value' => '<i class="fa fa-floppy-o"></i> ' . $locale->label->create->capsAll(), 'class' => 'btn btn-primary btn-lg submit'));
?>
            </form>         
        </div>
        </div>
    </div>
    </div>
    <?php 
echo html::render('appfarm/tpl/footer.php');
?>
    
 public function __construct($view, $model, $locale, $conf)
 {
     request::load();
     session::load();
 }