Example #1
0
 public function get_cms_list_wrapper($value, $object_class, $id)
 {
     $this->attributes['data-ajax-click'] = $object_class . ':' . $this->field_name;
     $this->attributes['data-ajax-post'] = '{"id":' . $id . '}';
     $this->attributes['data-ajax-shroud'] = '#button' . $this->field_name . $id;
     return node::create('a#button_' . $this->field_name . $id . '.btn.btn-default', $this->attributes, icon::get($this->field_name));
 }
Example #2
0
 public function get_html_wrapper()
 {
     $html = '';
     $html .= $this->pre_text;
     if (!$this->hidden && isset($this->label) && !empty($this->label)) {
         $html .= node::create('label.control-label.col-md-' . $this->parent_form->bootstrap[0], ['for' => $this->field_name, 'id' => $this->field_name . '_wrapper'], $this->label);
     }
     $html .= node::create('div.col-md-' . $this->parent_form->bootstrap[1] . ' div.fileinput.fileinput-new.input-group', ['data-provides' => 'fileinput'], [node::create('div.form-control', ['data-trigger' => 'fileinput'], [icon::get('file', 'i', ['class' => ['fileinput-exists']]), node::create('span.fileinput-filename', [], '')]), node::create('span.input-group-addon.btn.btn-default.btn-file', [], [node::create('span.fileinput-exists', [], 'Change'), node::create('span.fileinput-new', [], 'Select File'), $this->get_html()]), node::create('a.input-group-addon.btn.btn-default.fileinput-exists.fileremove', ['data-dismiss' => 'fileinput'], 'Remove')]);
     $html .= $this->post_text;
     return $html;
 }
Example #3
0
 public function get_view()
 {
     $html = node::create('div.content', [], $this->module->current->body);
     $pages = page::get_all(['title', 'info', 'module_name', 'fn', 'icon'], ['order' => 'position', 'where' => 'pid != 12']);
     if ($pages) {
         $html .= node::create('div#page_list', [], $pages->iterate_return(function (page $page) {
             return node::create('div.page', [], node::create('a', ['href' => $page->get_url()], node::create('h2', [], icon::get($page->icon) . '<br/>' . $page->title) . ($page->info ? node::create('p', [], $page->info) : '')));
         }));
     }
     return $html;
 }
Example #4
0
 public function get()
 {
     if (!ajax) {
         \core::$inline_script[] = 'loaded_modules = {"' . uri . '":true};';
         $html = node::create('div#left_col', [], node::create('div#nav ul', [], \core::$singleton->module->get_main_nav()) . node::create('div#main_wrapper div#main', [], node::create('div#' . $this->get_page_selector(), ['data-uri' => isset($_POST['url']) ? $_POST['url'] : uri], $this->get_view()))) . node::create('div#map_interface_3d', [], icon::get('chevron-left', 'span', ['class' => ['show', 'toggle']]) . icon::get('remove', 'span', ['class' => ['hide', 'toggle']]) . node::create('div#tree_content', [], node::create('a.load_airspace.button', ['href' => '#', 'onclick' => 'map.load_airspace();'], 'Load Airspace'))) . node::create('div#map_wrapper', [], node::create('div#waypoint_mode_help', [], 'You are in waypoint mode') . node::create('div#map_interface', [], node::create('div#map_interface_padding', [], node::create('div#graph_wrapper', [], '') . node::create('div#slider', [], '') . node::create('div#controls', [], node::create('a#play.glyphicon.glyphicon-play', ['onclick' => "map.play()"], 'Play') . node::create('a#pause.glyphicon.glyphicon-pause', ['onclick' => "map.pause()"], 'Pause') . node::create('a#slider_time', [], '00:00')))) . node::create('div#map p.loading', [], 'Google Maps are loading...') . node::create('div#map3d p.loading', [], 'Google Earth is loading...'));
         return $html;
     } else {
         $content = $this->get_view();
         return ['#main', 'append', '<div id="' . $this->get_page_selector() . '" data-url="' . (isset($_POST['url']) ? $_POST['url'] : '/' . uri) . '">' . $content . '</div>', '#' . $this->get_page_selector()];
     }
 }
Example #5
0
 public function get_cms_admin_edit()
 {
     $cols = [];
     $cols[] = node::create('td span.btn.btn-default.live' . ($this->live ? '' : '.not_live'), [], icon::get($this->live ? 'ok' : 'remove'));
     $cols[] = node::create('td span.btn.btn-default.edit', ['href' => '/' . $this->fid . '/?module=\\module\\cms\\object\\_cms_module&act=get_edit_field_form&fid=' . $this->fid, 'data-target' => '#modal', 'data-toggle' => 'modal'], icon::get('pencil'));
     $cols[] = node::create('td', [], $this->fid);
     $cols[] = node::create('td', [], node::create('a.up.reorder.btn.btn-default', ['data-ajax-click' => 'cms:do_reorder_fields', 'data-ajax-post' => '{"mid":' . $this->parent_form->get_module_id() . ',"fid":' . $this->fid . ',"dir":"up"}'], icon::get('arrow-up')) . node::create('a.down.reorder.btn.btn-default', ['data-ajax-click' => 'cms:do_reorder_fields', 'data-ajax-post' => '{"mid":' . $this->parent_form->get_module_id() . ',"fid":' . $this->fid . ',"dir":"down"}'], icon::get('arrow-down')));
     $cols[] = node::create('td', [], $this->title);
     $cols[] = node::create('td', [], $this->field_name);
     $cols[] = node::create('td', [], get::__class_name($this));
     $fields = ['list', 'required', 'filter'];
     foreach ($fields as $field) {
         $list_options = ['data-ajax-change' => 'form\\field_boolean:update_cms_setting', 'data-ajax-post' => '{"fid":' . $this->fid . ', "field":"' . $field . '"}', 'value' => 1, 'type' => 'checkbox'];
         if ($this->{$field}) {
             $list_options['checked'] = 'checked';
         }
         $cols[] = node::create('td input#' . $this->fid . '_list', $list_options);
     }
     $cols[] = node::create('td', [], $this instanceof field_image ? $this->get_image_edit_link() : '');
     return $cols;
 }
Example #6
0
 /**
  * @return array
  */
 public function get_cms_list()
 {
     $fields = $this->get_fields(true);
     $live_attributes = ['href' => '#', 'data-ajax-click' => get_class($this) . ':do_toggle_live', 'data-ajax-post' => '{"mid":' . static::get_module_id() . ',"id":' . $this->get_primary_key() . '}'];
     $up_attributes = ['data-ajax-click' => get_class($this) . ':do_reorder', 'data-ajax-post' => '{"mid":' . static::get_module_id() . ',"id":' . $this->get_primary_key() . ',"dir":"up"}'];
     $down_attributes = ['data-ajax-click' => get_class($this) . ':do_reorder', 'data-ajax-post' => '{"mid":' . static::get_module_id() . ',"id":' . $this->get_primary_key() . ',"dir":"down"}'];
     $delete_attributes = $undelete_attributes = $true_delete_attributes = ['data-ajax-post' => '{"id":"' . $this->get_primary_key() . '","mid":"' . $this->get_module_id() . '"}', 'data-toggle' => 'modal', 'data-target' => '#delete_modal'];
     $undelete_attributes['data-target'] = '#undelete_modal';
     $true_delete_attributes['data-target'] = '#true_delete_modal';
     $expand_attributes = ['href' => '#', 'data-ajax-click' => get_class($this) . ':do_toggle_expand', 'data-ajax-post' => '{"mid":' . static::get_module_id() . ',"id":' . $this->get_primary_key() . '}'];
     $nestable = static::$cms_modules[get_class($this)]->nestable;
     return node::create('td.btn-col a.btn.btn-primary', ['href' => '/cms/edit/' . static::get_module_id() . '/' . $this->get_primary_key()], icon::get('pencil')) . node::create('td.bnt-col a.btn.btn-primary', $live_attributes, icon::get($this->live ? 'ok' : 'remove')) . ($nestable ? node::create('td.edit' . ($this->_has_child ? '' : '.no_expand'), [], $this->_has_child ? node::create('a.expand.btn.btn-primary', $expand_attributes, icon::get(!$this->_is_expanded ? 'plus' : 'minus')) : '') : '') . node::create('td.btn-col2', [], node::create('a.btn.btn-primary', $up_attributes, icon::get('arrow-up')) . node::create('a.btn.btn-primary', $down_attributes, icon::get('arrow-down'))) . $fields->iterate_return(function ($field) {
         $field->parent_form = $this;
         if ($field->list) {
             return node::create('td.' . get_class($field), [], $field->get_cms_list_wrapper(isset($this->{$field->field_name}) ? $this->{$field->field_name} : '', get_class($this), $this->get_primary_key()));
         }
         return '';
     }) . node::create('td.btn-col', [], $this->deleted ? [node::create('button.delete.btn.btn-info', $undelete_attributes, '<s>' . icon::get('trash') . '</s>'), node::create('button.delete.btn.btn-warning', $true_delete_attributes, '<s>' . icon::get('fire') . '</s>')] : node::create('button.delete.btn.btn-warning', $delete_attributes, icon::get('trash')));
 }