function init() { parent::init(); $this->add('H3')->setHtml('<i class="glyphicon glyphicon-list-alt"></i> xEpan Components Repository <small>Search and install from components available </small>'); $this->add_component_btn = $this->add('componentList/View_AddComponentToRepository'); //TODO keep the line below in single CMS $this->add('Controller_EpanCMSApp')->ownerComponentRepository(); $form = $this->add('Form'); $form->addClass('stacked'); $search_field = $form->addField('line', 'search_components', '')->setAttr('placeholder', 'Search / Filter Component'); $market_place = $this->add('Model_MarketPlace'); $market_place->addCondition('type', '<>', 'element'); if ($this->api->auth->model->ref('epan_id')->get('name') != $this->api->getConfig('default_site')) { $market_place->addCondition('is_system', false); } if ($_GET['search']) { $market_place->addCondition('name', 'like', '%' . $_GET['search'] . '%'); } $mp = $this->add('componentList/View_MarketPlaceComponents'); $mp->setModel($market_place); $mp->add('Paginator')->ipp(15); if ($form->isSubmitted()) { $mp->js()->reload(array('search' => $form['search_components']))->execute(); } }
function init() { parent::init(); if ($_GET['message_id']) { $msg = $this->add('Model_Messages')->load($_GET['message_id']); } $v = $this->add('View_Info')->set('Message Detail'); $this->add('View')->set('Name - ' . $msg['name']); $this->add('View')->set('From - ' . $msg['sender_signature']); $this->add('View')->set('Message - ' . $msg['message']); }
function init() { parent::init(); $class = get_class($this); preg_match('/page_(.*)_page_(.*)/', $class, $match); $this->component_namespace = $match[1]; $mp = $this->add('Model_MarketPlace')->loadBy('namespace', $this->component_namespace); $this->component_name = $mp['name']; $l = $this->api->locate('addons', $match[1], 'location'); $this->api->pathfinder->addLocation($this->api->locate('addons', $match[1]), array('template' => 'templates', 'css' => 'templates/css'))->setParent($l); $cols = $this->add('Columns'); $left = $cols->addColumn(6); $right = $cols->addColumn(6); $this->h1 = $h1 = $left->add('H3')->set($this->component_name); $this->toolbar = $right->add('ButtonSet')->addClass('pull-right'); $about_page = $right->add("VirtualPage"); $about_page->set(function ($p) use($match) { $p->add('View', null, null, array('view/' . $match[1] . '-about')); }); $uninstall_page = $right->add("VirtualPage"); $uninstall_page->set(function ($p) use($match) { $p->add('View_Error')->set('Are you sure, you want to uninstall this application'); $btn = $p->add('Button')->set('Yes'); if ($btn->isClicked()) { $p->api->redirect($p->api->url($match[1] . '_page_uninstall')); } }); $update_page = $right->add("VirtualPage"); $update_page->set(function ($p) use($match) { $p->add('View_Info')->set('Are you sure, you want to update this application'); $form = $p->add('Form'); $form->addField('line', 'git_exec_path')->set('/usr/bin/git')->validateNotNull(); $form->addField('DropDown', 'git_branch')->setValueList(array('master' => 'master', 'develop' => 'develop'))->set('master')->validateNotNull(); $form->addSubmit('Update'); if ($form->isSubmitted()) { $p->js()->univ()->frameURL('Update This Component', $p->api->url($p->api->url($match[1] . '_page_owner_update', array('git_exec_path' => $form['git_exec_path'], 'git_branch' => $form['git_branch']))))->execute(); } }); $i_b = $this->toolbar->addButton('Info'); $i_b->setIcon('ui-icon-info'); $i_b->js('click', $this->js()->univ()->frameURL('About This Component', $about_page->getURL())); $u_b = $this->toolbar->addButton('Update'); $u_b->setIcon('ui-icon-arrowthick-1-n'); $u_b->js('click', $this->js()->univ()->frameURL('Update This Component', $update_page->getURL())); $un_b = $this->toolbar->addButton('Uninstall'); $un_b->seticon('ui-icon-cancel'); $un_b->js('click', $this->js()->univ()->frameURL('Uninstall This Component', $uninstall_page->getURL())); if ($this->api->isAjaxOutput() or $_GET['cut_page']) { $h1->destroy(); $this->toolbar->destroy(); } }
function init() { parent::init(); $this->add('H3')->setHTML('<i class="fa fa-clipboard"></i> ' . strtoupper($this->api->current_website['name']) . " :: Templates <small> Templates for your xEpan </small>"); if ($_GET['edit_template']) { $this->api->redirect($this->api->url('/', array('edit_template' => $_GET['edit_template']))); } $crud = $this->add('CRUD'); $crud->setModel($this->api->current_website->ref('EpanTemplates'), array('name', 'css'), array('name', 'is_current')); if ($g = $crud->grid) { $g->addColumn('Button', 'edit_template'); } $crud->add('Controller_FormBeautifier'); }
function init() { parent::init(); $this->add('H3')->setHTML('<i class="fa fa-dashboard"></i> ' . strtoupper($this->api->current_website['name']) . " Dashboard <small>One shot view for your Website/Application</small>"); $main_cols = $this->add('Columns'); $app_dash = $main_cols->addColumn(8); $manager_report_col = $main_cols->addColumn(4); $xAi_installed = $this->add('Model_InstalledComponents'); $xAi_installed->addCondition('name', 'xAtrificial Intelligence'); $xAi_installed->tryLoadAny(); if ($xAi_installed->loaded()) { $graphs = $this->add('xAi/Model_VisualAnalytic')->addCondition('push_to_main_dashboard', true)->setOrder('main_dashboard_order')->setLimit(4); $i = 0; foreach ($graphs as $junk) { $analytic_to_draw = $this->add('xAi/Model_VisualAnalytic')->load($junk['id']); if ($i == 0) { $row = $app_dash->add('Columns'); } if ($analytic_to_draw['visual_style'] == 'grid') { $col = $row->addColumn(1 * ($analytic_to_draw['span_on_main_dashboard'] ?: 1)); $dch = $col->add('xAi/View_DynamicDataTable', array('analytic' => $analytic_to_draw)); } else { $col = $row->addColumn(1 * ($analytic_to_draw['span_on_main_dashboard'] ?: 1)); $dch = $col->add('xAi/View_DynamicChart', array('analytic' => $analytic_to_draw)); $dch->chart->options['legend'] = array('layout' => 'horizontal', 'align' => 'center', 'verticalAlign' => 'bottom'); } $i++; } $manager_view = $manager_report_col->add('View')->addClass('list-group'); $manager_view_heading_view = $manager_view->add('View')->setElement('a')->addClass('list-group-item active text-center')->setAttr('href', '#'); $manager_view_heading = $manager_view_heading_view->add('H3')->addClass('list-group-item-heading')->set('xAi : Manager Report'); $manager_view_heading_text = $manager_view_heading_view->add('View')->addClass('list-group-item-text')->set('Reserved space for full Ai version, Subscribe to get notified'); $temp_array = array('success', 'info', 'warning', 'danger'); $mind_array = array('Task Report', 'Suggession', 'Thinking'); for ($i = 0; $i <= 8; $i++) { $type = $temp_array[array_rand($temp_array)]; $mind = $mind_array[array_rand($mind_array)]; $manager_view->add('View')->addClass('list-group-item alert alert-' . $type)->setHTML('<i class="glyphicon glyphicon-' . $type . '-sign"></i> Some Random ' . $mind); } } }
function init() { parent::init(); $this->add('H3')->setHTML('Installed Components <small>Your installed components</small>'); $form = $this->add('Form'); $form->addClass('stacked'); $search_field = $form->addField('line', 'search_components', '')->setAttr('placeholder', 'Search / Filter Your Installed Component'); $installed_components = $this->add('Model_InstalledComponents'); $installed_components->addCondition('epan_id', $this->api->current_website->id); $installed_components->addCondition('type', '<>', 'element'); if ($this->api->auth->model->ref('epan_id')->get('name') != $this->api->getConfig('default_site')) { $installed_components->addCondition('is_system', false); } if ($_GET['search']) { $installed_components->addCondition('name', 'like', '%' . $_GET['search'] . '%'); } $mp = $this->add('componentList/View_InstalledComponents'); $mp->setModel($installed_components); if ($form->isSubmitted()) { $mp->js()->reload(array('search' => $form['search_components']))->execute(); } }