Example #1
0
 function recursiveRender()
 {
     if ($this->chart) {
         $this->chart->onRender($this->js()->masonry(['itemSelector' => '.widget'])->_selector('.widget-grid')->_enclose());
     }
     return parent::recursiveRender();
 }
Example #2
0
 function recursiveRender()
 {
     $this->addClass($this->class);
     $this->template->trySet('icon', $this->icon);
     $this->template->trySetHtml('heading', $this->heading);
     $this->template->trySetHtml('value', $this->value);
     parent::recursiveRender();
 }
Example #3
0
 function recursiveRender()
 {
     if ($this->options['addCloseButton']) {
         $this->addCloseButton();
     }
     if ($this->options['addSaveButton']) {
         $this->addSaveButton();
     }
     parent::recursiveRender();
 }
Example #4
0
 function recursiveRender()
 {
     if ($this->api->edit_mode) {
         // EDIT START
         // Add Location for templates in component base
         $l = $this->api->locate('addons', __NAMESPACE__, 'location');
         $this->api->pathfinder->addLocation($this->api->locate('addons', __NAMESPACE__), array('template' => 'templates', 'css' => 'templates/css', 'js' => 'templates/js'))->setParent($l);
         if ($this->is_sortable) {
             $this->template->append('class', 'epan-sortable-component ');
         }
         if ($this->is_resizable) {
             $this->template->append('class', 'ui-resizable');
         }
     }
     parent::recursiveRender();
 }
Example #5
0
 function recursiveRender()
 {
     $template = $this->add('GiTemplate');
     $template->loadTemplate('view/report/balancesheet');
     $temp = $template->render();
     /*Find [{}] String from template*/
     // preg_match_all("/{([^:}]*):?([^}]*)}/", $temp,$match);
     // preg_match_all("/\[[^\]]*\]/", $temp,$match);
     preg_match_all('/( { ( (?: [^{}]* | (?1) )* ) } )/x', $temp, $match);
     /*Include EvalMath Class*/
     $x = new \Webit\Util\EvalMath\EvalMath();
     /*Get value from specific BalanceSheet , Group And Ledger save in array*/
     $array_model = [];
     foreach ($match[2] as $m) {
         $value = explode(":", $m);
         switch ($value[0]) {
             case 'HEAD':
                 $model = $this->add('xepan\\accounts\\Model_BalanceSheet')->addCondition('name', $value[1])->tryLoadAny();
                 $array_model[$value[0] . ':' . $value[1]] = $model->getBalance($this->from_date, $this->to_date);
                 break;
             case 'GROUP':
                 $model = $this->add('xepan\\accounts\\Model_Group')->addCondition('name', $value[1])->tryLoadAny();
                 $array_model[$value[0] . ':' . $value[1]] = $model->getBalance($this->from_date, $this->to_date);
                 break;
             case 'LEDGER':
                 $model = $this->add('xepan\\accounts\\Model_Ledger')->addCondition('name', $value[1])->tryLoadAny();
                 $array_model[$value[0] . ':' . $value[1]] = $model->getBalance($this->from_date, $this->to_date);
                 break;
         }
     }
     /*Find Actual Value From Template String & Eval */
     $result = str_replace($match[0], $array_model, $temp);
     preg_match_all("/\\[[^\\]]*\\]/", $result, $res);
     $r = [];
     foreach ($res[0] as $str) {
         $res = substr($str, 1, -1);
         if ($res) {
             $r[$str] = $x->evaluate($res);
         }
     }
     /*set Final Value From String */
     foreach ($r as $key => $value) {
         $result = str_replace($key, $value, $result);
     }
     $this->setHTML($result);
     parent::recursiveRender();
 }
Example #6
0
 function recursiveRender()
 {
     if ($this->mode == 'auto') {
         $cnt = 0;
         foreach ($this->elements as $el) {
             if ($el instanceof View_Columns_Column) {
                 $cnt++;
             }
         }
         if ($cnt) {
             foreach ($this->elements as $el) {
                 if ($el instanceof View_Columns_Column) {
                     $el->setStyle('width', round(100 / $cnt, 2) . '%');
                 }
             }
         }
         $this->template->trySet('class', 'atk-flexy');
     }
     return parent::recursiveRender();
 }
Example #7
0
 function recursiveRender()
 {
     return parent::recursiveRender();
 }
Example #8
0
File: Chart.php Project: xepan/base
 function recursiveRender()
 {
     if ($this->model) {
         $t = array_merge($this->y_Axis_fields, [$this->x_Axis_field]);
         $data_t = $this->model->getRows($t);
         $data = [];
         foreach ($data_t as $row) {
             $r = [];
             foreach ($t as $req_field) {
                 $r[$req_field] = $row[$req_field];
             }
             $data[] = $r;
         }
         $this->options['data']['json'] = $data;
     }
     if ($this->model && $this->type == 'pie') {
         $formatted_data = [];
         $formatted_values = [];
         foreach ($data as $row) {
             foreach ($this->y_Axis_fields as $fld) {
                 $formatted_data[] = [$row[$this->x_Axis_field] => $row[$fld]];
                 $formatted_values[] = $row[$this->x_Axis_field];
             }
         }
         unset($this->options['data']['keys']['x']);
         $this->options['data']['json'] = $formatted_data;
         $this->options['data']['keys']['value'] = $formatted_values;
         if ($this->setLabelToValue) {
             $this->options['pie']['label']['format'] = $this->js(null, 'return ev')->_enclose();
         }
     }
     if ($this->type) {
         $this->options['data']['type'] = $this->type;
     }
     parent::recursiveRender();
 }
Example #9
0
 function recursiveRender()
 {
     $this->js('hover', $this->js()->slideToggle('slow')->_selector('.image-caption'))->_selector('.image-wrapper');
     $action = $this->api->stickyGET('action') ?: 'view';
     if ($action == 'edit') {
         $this->js('click')->_selector('.profile-img')->univ()->frameURL('Change Image', $this->vp->getURL());
     }
     return parent::recursiveRender();
 }
Example #10
0
 function recursiveRender()
 {
     $this->model->loadBy('name', $this->file . '.md');
     $this->template->loadTemplateFromString($this->model['rendered']);
     parent::recursiveRender();
 }
Example #11
0
File: Tool.php Project: xepan/xepan
 function recursiveRender()
 {
     $this->template->trySet('namespace', $this->namespace);
     $this->template->set('title', $this->display_name);
     $this->template->set('class', $this->class);
     $icon_path = 'epan-components/' . $this->namespace . '/templates/images/';
     if ($this->icon_file == null) {
         $this->icon_file = strtolower(str_replace(" ", "", $this->title)) . "_icon.png";
         if (!file_exists($icon_path . $this->icon_file)) {
             // throw $this->exception($icon_path.$this->icon_file);
             $icon_path = 'epan-addons/editingToolbar/templates/images/';
             $this->icon_file = 'defaultTool.png';
         }
     }
     $this->template->trySet('icon', $icon_path . $this->icon_file);
     // What to drop by Tool
     // if serverside then serverside view with proper attributes or
     // html of the required view
     if ($this->is_serverside) {
         $drag_html = $this->add('View', null, null, array('view/editingToolbar-tool-ssc'));
         $drag_html->template->append('attributes', 'component_namespace="' . $this->namespace . '"');
         $drag_html->template->append('attributes', 'component_type="' . str_replace("View_Tools_", "", $this->class) . '"');
         $drag_html->setAttr('data-responsible-namespace', $this->namespace);
         $drag_html->setAttr('data-responsible-view', $this->class);
         $drag_html->setAttr('data-is-serverside-component', 'true');
         $drag_html->template->append('class', ' epan-component ');
         $this->drag_html = $drag_html->getHTML();
     } else {
         // No Drag HTML defined by tool, lets try to make here
         $drag_html = $this->add($this->namespace . '/' . $this->class);
         if ($this->is_sortable) {
             $drag_html->template->append('class', ' epan-sortable-component ');
             $this->template->trySet('create_sortable', 'true');
         } else {
             $this->template->trySet('create_sortable', 'false');
         }
         if ($this->is_resizable) {
             $drag_html->template->append('class', ' ui-resizable ');
         }
         if ($drag_html->items_allowed !== null) {
             $this->template->trySet('items_allowed', $drag_html->items_allowed);
         }
         if ($drag_html->items_cancelled !== null) {
             $this->template->trySet('items_cancelled', $drag_html->items_cancelled);
         }
         $drag_html->template->append('attributes', 'component_namespace="' . $this->namespace . '"');
         $drag_html->template->append('attributes', 'component_type="' . str_replace("View_Tools_", "", $this->class) . '"');
         $drag_html->template->append('class', 'epan-component ');
         $this->drag_html = $drag_html->getHTML();
     }
     $this->template->trySetHTML('drag_html', $x = str_replace("'", '"', trim(preg_replace('#\\R+#', ' ', str_replace("/s", "\\/s", $this->drag_html)))));
     // OPTIONS  to be shown on Quick Component options
     if (file_exists($template_file = getcwd() . '/epan-components/' . $this->namespace . '/templates/view/' . $this->namespace . '-' . str_replace("View_Tools_", "", $this->class) . '-options.html')) {
         $options = $this->add('componentBase/View_Options', array('namespace' => $this->namespace, 'component_type' => str_replace("View_Tools_", "", $this->class)), 'options');
     } else {
     }
     $drag_html->destroy();
     parent::recursiveRender();
 }
Example #12
0
 function recursiveRender()
 {
     if (!$this->id_field_on_reload) {
         throw $this->exception("Please provice 'id_field_on_reload'");
     }
     if ($this->action != 'view') {
         $this->form->onSubmit(function ($f) {
             $f->save();
             if ($this->page_reload) {
                 return $this->js(null, $this->js()->univ()->notify('Saved', 'Document Saved', 'user', 'attached', 'bouncyflip'))->univ()->location($this->api->url(null, [$this->id_field_on_reload => $f->model->id, 'action' => $this->action == 'add' ? 'edit' : $this->action]));
             } else {
                 return $this->js(null, $this->js()->univ()->notify('user', 'Saved', 'attached', 'bouncyflip'))->reload(null, null, $this->api->url(null, [$this->id_field_on_reload => $f->model->id, 'action' => $this->action == 'add' ? 'edit' : $this->action, 'cut_object' => $this->name]));
             }
         });
     }
     return parent::recursiveRender();
 }