/** * 配合BuilderView使用 * 自动加载 application.fields下的字段类型 */ static function builder($arr) { //实例化的beginWidget('CActiveForm') $form = $arr['form']; //字段名 $name = $arr['name']; $model = $arr['model']; $htmlOptions = array('class' => 'form-control'); //单个字段的详细配置 $v = $arr['v']; //字段类型 对应application.fields下的文件名 $type = $v['type']; $obj = new $type(); $chtmlField = $obj->type; if ($v['widget']) { foreach ($v['widget'] as $k => $vo) { echo widget($k, $vo); } } if ($type == 'checkbox') { $htmlOptions = array('class' => 'checkbox'); } if (!$chtmlField && method_exists($obj, 'action')) { return $obj->action($name, $v['model'], $model->{$name}); } if (!$chtmlField) { return; } if (array_key_exists('datas', $v)) { $values = $v['datas']; $htmlOptions['encode'] = false; return $form->{$chtmlField}($model, $name, $values, $htmlOptions); } return $form->{$chtmlField}($model, $name, $htmlOptions); }
function widgetsOfSidebar($sidebar) { $widgets = \DB::table("sidebar_widget")->where("sidebar", $sidebar)->get(); foreach ($widgets as $widget) { $widget_object = widget($widget->id_string, $sidebar); $widget_object->display($widget->id_string); } }
/** * testWidgetHelperFunction * * @return void */ public function testWidgetHelperFunction() { $handler = $this->handler; $containerMock = m::mock('Illuminate\\Contracts\\Container\\Container'); $handler->shouldReceive('create')->andReturn('test widget called'); $containerMock->shouldReceive('make')->andReturn($handler); Container::setInstance($containerMock); $this->assertSame('test widget called', widget('test@testWidgetId', [])); }
function action($name, $model, $v) { if ($v) { if (is_array($v)) { } else { $value = CDB()->from('attachments')->where('id=:id', array(':id' => $v))->queryAll(); } } $name = "AutoModel[{$name}]"; echo widget('plupload', array('field' => $name, 'multi' => false, 'values' => $value)); }
public function actionIndex() { widget('uisort', array('tag' => '.drag', 'table' => 'modules', 'stop' => "\$.get('" . url('admin/admin/menu') . "',function(data){ \n\t \t\t\t\$('#menu').html(data);\n\t \t });\n\t \t")); if ($_POST['uisort_widget_ajax'] != 'uisort_modules') { $base = $this->_base; $models = Modules::find()->where(array('active' => 1))->orderBy('core asc,sort desc,id asc')->all(); if ($models) { foreach ($models as $model) { $name = $model->name; $array[$name]['name'] = $name; $array[$name]['active'] = $model->active; $array[$name]['core'] = $model->core; $array[$name]['path'] = $base . $name; $array[$name]['info'] = @(include $base . $name . '/info.php'); } } foreach (glob($base . '*') as $v) { $a = '/controllers'; $name = str_replace($base, '', $v); if (!is_dir($v)) { continue; } $data[$name]['default'] = false; if (file_exists($v . '/lock')) { unset($data[$name]); continue; } $data[$name]['name'] = $name; $data[$name]['path'] = $v; $data[$name]['info'] = @(include $v . '/info.php'); if ($array[$name]) { unset($data[$name]); } $file[$name] = $name; } if ($array) { foreach ($array as $k => $v) { if (!in_array($k, $file)) { $m = Modules::find(array('name' => $k)); $m->delete(); unset($array[$k]); } } } if ($array) { $data = array_merge($data, $array); } echo $this->render('index', array('data' => $data, 'models' => $models, '_core_modules' => $this->_core_modules)); } }
<div class="frame-crumbs"> <?php echo widget('path'); ?> </div> <div class="frame-inside page-text"> <div class="container"> <div class="text-right"> <div class="text"> <h1><?php echo $page['title']; ?> </h1> <?php echo $page['full_text']; ?> <?php $Comments = $CI->load->module('comments')->init($page); ?> <?php $c = $CI->load->module('comments/commentsapi')->renderAsArray($CI->uri->uri_string()); ?> <div class="forComments p_r"> <?php echo $c['comments']; ?> </div> </div> </div> </div> </div><?php
<?php import('layouts/header', $data['title']); widget('topnav'); ?> <div class="container"> <div class="row"> <div class="col-md-3 hidden-xs hidden-sm"> <?php widget('loginBox'); ?> </div> <div class="col-sm-12 col-md-9"> <h2 class="page-header" style="margin-top:0;"><?php echo $data['title']; ?> </h2> <div id="contents"><?php echo $data['content']; ?> </div> <div class="row"> <div class="col-xs-12"> <?php if (in_array(auth('id'), explode(',', $data['readIn']))) { ?> <button class="btn btn-default" disabled>รับทราบแล้ว</button> <?php } else { ?> <button id="ack" class="btn btn-primary">รับทราบแล้ว</button>
type: 'post', data : { id: id, csrf_token: '<?php echo csrf_token(); ?> ' }, success: function(json) { getAll(); } }); } } </script> <?php } else { ?> <?php widget('InActive'); ?> <div class="alert alert-warning"> <h3><i class="glyphicon glyphicon-bullhorn"></i> ประกาศ</h3><hr /> <p>ขณะนี้คุณยังไม่สามารถใช้งานระบบได้ กรุณารอจนกว่าประธานสาขาของคุณจะตรวจสอบและรับเข้านะครับ</p> <p>ต้องขออภัยในความไม่สะดวก</p><hr /> </div> <?php } ?> </div> </div> </div> <?php import('layouts/footer');
<td> <?php echo widget('Admin.Category')->edit($value); ?> <?php echo widget('Admin.Category')->delete($value); ?> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> <?php echo $page; ?> </div> <?php echo widget('Admin.Common')->footer(); ?> </div> </div> <?php echo widget('Admin.Common')->htmlend();
/** * 视图回调函数[显示小挂件] * * @author Garbin * @param array $options * @return void */ function display_widgets($options) { $area = isset($options['area']) ? $options['area'] : ''; $page = isset($options['page']) ? $options['page'] : ''; if (!$area || !$page) { return; } include_once ROOT_PATH . '/includes/widget.base.php'; /* 获取该页面的挂件配置信息 */ $widgets = get_widget_config($this->_get_template_name(), $page); /* 如果没有该区域 */ if (!isset($widgets['config'][$area])) { return; } /* 将该区域内的挂件依次显示出来 */ foreach ($widgets['config'][$area] as $widget_id) { $widget_info = $widgets['widgets'][$widget_id]; $wn = $widget_info['name']; $options = $widget_info['options']; $widget =& widget($widget_id, $wn, $options); $widget->display(); } }
<div class="header"> <div class="logo">微店管理系统</div> <div class="header-right"> <i class="icon-user icon-white"></i> <a href="#"><?php echo $username; ?> </a> <i class="icon-edit icon-white"></i> <a href="javascript:;" data-dialog-id="modify-password" class="modify-password">修改密码</a> <i class="icon-off icon-white"></i> <a id="modal-973558" href="<?php echo route('foundation.login.out'); ?> " role="button" >注销</a> </div> </div> <?php echo widget('Admin.Common')->mpassword(); ?> <!-- 顶部 -->
public function head() { $this->config->load('fabtotum', TRUE); $this->load->helper('form'); $this->load->helper('smart_admin_helper'); $_units = json_decode(file_get_contents($this->config->item('fabtotum_config_units', 'fabtotum')), TRUE); if (isset($_units['settings_type']) && $_units['settings_type'] == 'custom') { $_units = json_decode(file_get_contents($this->config->item('fabtotum_custom_config_units', 'fabtotum')), TRUE); } $data['units'] = $_units; $data['heads_list'] = array_merge(array('head_shape' => '---'), $this->config->item('heads_list', 'fabtotum'), array('more_heads' => 'Get more heads')); $data['heads_descriptions'] = $this->config->item('heads_descriptions', 'fabtotum'); $data['head'] = isset($_units['hardware']['head']['type']) ? $_units['hardware']['head']['type'] : 'head_shape'; $widget_config['data-widget-icon'] = 'fa fa-toggle-down'; $widget = widget('heads' . time(), 'Heads', $widget_config, $this->load->view('head/widget', $data, TRUE), false, true, false); $data['widget'] = $widget; $this->layout->add_js_in_page(array('data' => $this->load->view('head/js', $data, TRUE), 'comment' => '')); $this->layout->view('head/index', $data); }
/** * 评论的列表,用于异步加载 */ public function ls() { $objectId = (int) Request::input('objectid'); $view = widget('Home.Common')->comment($objectId); return response($view); }
<?php css(theme_url() . '/css/fix.css'); widget('cycle', array('tag' => '#cycle', 'options' => array('pager' => '#cycle_pager', 'timeout' => 1000))); widget('cycle', array('tag' => '#cycle2', 'options' => array('pager' => '#cycle_pager2', 'timeout' => 0))); foreach ($posts as $p) { echo $p->id . '<br>'; } $this->widget('LinkPager', array('pages' => $pages)); exit; ?> <div class="middle"> <div class="one"> <div class="oneleft"> <p class="leftxin"><img src="<?php echo theme_url(); ?> /images/xiang.png" width="337" height="343" /></p> <ul class="onelist"> <li> <p class="col"><a href="#">10,000 success students</a></p> <p class="colone"><a href="#">word of mouth reputation</a></p> </li> <li> <p class="col"><a href="#">200 professional Chinese teaching team</a></p> <p class="colone"><a href="#">providing high quality language service</a></p> </li> <li> <p class="col"><a href="#">10 years experience in teaching Chinese</a></p> <p class="colone"><a href="#">as a second language</a></p>
<?php } ?> <!--End. Block Accessories--> </div> <!-- End. Tabs block--> <!--Start. Payments method form --> <!--End. Payments method form --> </div> </div> </div> <!-- Start. Similar Products--> <?php echo widget('similar'); ?> <!-- End. Similar Products--> </div> <!-- Start. Photo Popup Frame--> <div class="drop drop-style globalFrameProduct" id="photo"></div> </div> <script type="text/template" id="framePhotoProduct"> <button type="button" class="icon_times_drop" data-closed="closed-js"></button> <div class="drop-header"> <div class="title"><%- obj.title %></div> <div class="horizontal-carousel"> <div class="frame-fancy-gallery frame-thumbs"> <div class="fancy-gallery carousel-js-css">
<!DOCTYPE html> <html> <head> <title>Widget Samlpe</title> </head> <body> <div> Here is `views/sample/index.php`. </div> <div> <?php echo widget('Blog_widget::list_latest'); ?> </div> </body> </html>
/** * 配置挂件 * * @author Garbin * @param none * @return void */ function config_widget() { if (!IS_POST) { return; } $name = !empty($_GET['name']) ? trim($_GET['name']) : null; $id = !empty($_GET['id']) ? trim($_GET['id']) : null; /* 当前所编辑的页面 */ $page = !empty($_GET['page']) ? trim($_GET['page']) : null; if (!$name || !$id || !$page) { $this->_config_respond('_d.setTitle("' . Lang::get('no_such_widget') . '");_d.setContents("message", {text:"' . Lang::get('no_such_widget') . '"});'); return; } $page_config = get_widget_config(Conf::get('template_name'), $page); $widget =& widget($id, $name, $page_config['widgets'][$id]['options']); $options = $widget->parse_config($_POST); if ($options === false) { $this->json_error($widget->get_error()); return; } $page_config['tmp'][$id]['options'] = $options; /* 保存配置信息 */ $this->_save_page_config(Conf::get('template_name'), $page, $page_config); /* 返回即时更新的数据 */ $widget->set_options($options); $contents = $widget->get_contents(); $this->_config_respond('DialogManager.close("config_dialog");parent.disableLink(parent.$(document.body));parent.$("#' . $id . '").replaceWith(document.getElementById("' . $id . '").parentNode.innerHTML);parent.init_widget("#' . $id . '");', $contents); }
<div class="form-group"> <label >url</label> <input type="input" class="form-control" value="<?php echo $data->slug; ?> " name='slug' > </div> <div class="form-group"> <label>附件</label> <?php widget('JUI'); widget('Plupload', ['ele' => 'file', 'option' => ['CKEDITOR' => 'body', 'maxSize' => '30', 'class' => 'upload', 'count' => 100, 'data' => $data->file]]); ?> <?php widget('ckeditor', ['ele' => 'body']); ?> </div> <br style="clear:both;"> <div class="form-group"> <label>状态</label> <?php $status = [1 => '启用', 0 => '禁用']; ?> <p> <select name="status" class="select"> <?php $true = false;
<section> <?php widget('top_box2', 'h2'); ?> </section> <section> <h2>About being Qool</h2> <div class="6u-first"> <?php widget('top_box3', 'h2'); ?> </div> <div class="6u"> <?php widget('top_box4', 'h2'); ?> </div> </section> </div> <div class="8u"> <section class="right-content"> <h2><?php the('title'); ?> </h2> <?php the('content'); ?>
<script src="<?php echo url('/misc/app.js'); ?> "></script> <script src="<?php echo theme_url('/js/js.js'); ?> "></script> <?php widget('BootstrapSwitch'); widget('Select2', ['option' => []]); ?> <?php widget_render(); ?> <?php echo $this->view['footer']; ?> </body> </html> <?php if (!is_ajax()) {
<a class="brand" href="<?php echo url('site/index'); ?> "><?php echo __('backend admin'); ?> </a> <div class="nav-collapse collapse"> <?php echo Menu::widget(array('options' => array('class' => 'nav '), 'activateParents' => true, 'submenuTemplate' => '<ul class="dropdown-menu">{items}</ul>', 'items' => app\core\Menu::get())); ?> <div style="padding-top: 6px;"> <?php echo widget('select2', array('i18n' => true)); ?> </div> </div><!--/.nav-collapse --> </div> </div> </div> <div class="container" style="margin-top: 60px;"> <?php $this->beginBody(); ?>
</td> <td><?php echo $v['size']; ?> </td> <td><?php echo $v['time']; ?> </td> <td><?php if ($v['img'] === true) { echo image($k, array('resize' => array(54, 40))); } ?> </td> </tr> <?php } ?> </tbody> </table> </div> <?php widget('fancybox', array('tag' => '.fancybox')); } ?>
public function file($action, $object_id = 0, $file_id = 0) { $data['_object_id'] = $object_id; $data['_file_id'] = $file_id; if ($action == 'add') { if ($this->input->post()) { //carico X class database $this->load->database(); $this->load->model('objects'); $files = explode(',', $this->input->post('files')); $usb_files = explode(',', $this->input->post('usb_files')); $usb_files_id = array(); foreach ($usb_files as $file) { if ($file != '') { $tmp = str_replace(" ", "_", $file); array_push($usb_files_id, $this->copy_from_usb('/media/' . $file)); } } $this->objects->insert_files($this->input->post('object'), $files); $this->objects->insert_files($this->input->post('object'), $usb_files_id); redirect('objectmanager/edit/' . $this->input->post('object'), 'location'); } /** LOAD UPLOAD CONFIG */ $this->config->load('upload'); $js_data['accepted_files'] = $this->config->item('upload_accepted_files'); $js_data['_upload_max_filesize'] = ini_get("upload_max_filesize"); $js_data['_action'] = $action; $js_data['_object_id'] = $object_id; $js_data['_time'] = $data['_time'] = time(); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/dropzone/dropzone.min.js', 'comment' => 'DROPZONE JAVASCRIPT')); $js_in_page = $this->load->view('file/add/js', $js_data, TRUE); $this->layout->add_js_in_page(array('data' => $js_in_page, 'comment' => 'INIT DROPZONE')); /** LOAD FROM USB DISK FIRST TREE */ $data['folder_tree'] = array(); /* if(file_exists('/dev/sda1')){ $_destination = '/var/www/fabui/application/modules/objectmanager/temp/media.json'; $_command = 'sudo python /var/www/fabui/python/usb_browser.py --dest=' . $_destination; shell_exec($_command); //sleep ( 1); $data['folder_tree'] = json_decode(file_get_contents($_destination), TRUE); } */ $data['_action'] = $action; } if ($action == "view") { //ini_set( 'error_reporting', E_ALL ); //ini_set( 'display_errors', true ); /** LOAD HELPER */ $this->load->helper('ft_file_helper'); //carico X class database $this->load->database(); $this->load->model('files'); $file = $this->files->get_file_by_id($file_id); $data['_success'] = false; $attributes = json_decode($file->attributes, TRUE); $data['_file'] = $file; $data['is_stl'] = strtolower($file->file_ext) == '.stl'; /** IF NOT A STL FILE, GET GCODE MODEL INFO */ if (!$data['is_stl']) { $data['dimesions'] = 'processing'; $data['filament'] = 'processing'; $data['number_of_layers'] = 'processing'; $data['estimated_time'] = 'processing'; if (is_array($attributes)) { $dimensions = $attributes['dimensions']; $x = number_format($dimensions['x'], 2, '.', ''); $y = number_format($dimensions['y'], 2, '.', ''); $z = number_format($dimensions['z'], 2, '.', ''); $data['dimesions'] = $x . ' x ' . $y . ' x ' . $z . ' mm'; $data['filament'] = number_format($attributes['filament'], 2, '.', '') . ' mm'; $data['number_of_layers'] = $attributes['number_of_layers']; $data['estimated_time'] = $attributes['estimated_time']; } else { if (strtolower($file->file_ext) == '.gc' || strtolower($file->file_ext) == '.gcode' && $file->attributes != 'Processing') { gcode_analyzer($file->id); } } } $js_in_page = $this->load->view('file/view/js', $data, TRUE); $css_in_page = $this->load->view('file/view/css', '', TRUE); /** LAYOUT SETUP */ $this->layout->add_js_in_page(array('data' => $js_in_page, 'comment' => '')); $this->layout->add_css_in_page(array('data' => $css_in_page, 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/ace/src-min/ace.js', 'comment' => 'ACE EDITOR JAVASCRIPT')); $this->layout->set_compress(false); } if ($action == 'preview') { //carico X class database $this->load->database(); $this->load->model('files'); $file = $this->files->get_file_by_id($file_id); $data['file'] = $file; if (strtolower($file->file_ext) == '.stl') { $this->load->helper('smart_admin_helper'); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/thingiview/Three.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/thingiview/plane.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/thingiview/thingiview.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/colorpicker/bootstrap-colorpicker.min.js', 'comment' => '')); $attr['data-widget-fullscreenbutton'] = 'false'; $attr['data-widget-icon'] = 'fa fa-cube'; $widget_id = 'render_area' . time(); $widget_content = $this->load->view('file/preview/stl/widget', '', TRUE); $_widget_preview = widget($widget_id, 'Stl Viewer', $attr, $widget_content, false, false, true); $data['widget'] = $_widget_preview; $data['widget_id'] = $widget_id; $js_in_page = $this->load->view('file/preview/stl/js', $data, TRUE); $this->layout->add_js_in_page(array('data' => $js_in_page, 'comment' => '')); $action .= '/stl'; } else { /** LOAD HELPER */ $this->load->helper('ft_file_helper'); $this->load->helper('smart_admin_helper'); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/gcodeviewer/modernizr.custom.93389.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/gcodeviewer/sugar-1.2.4.min.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/gcodeviewer/Three.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/gcodeviewer/three.TrackballControls.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/gcodeviewer/gcode-parser.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/gcodeviewer/gcode-model.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/gcodeviewer/renderer.js', 'comment' => '')); $attributes = json_decode($file->attributes, TRUE); $data_widget['dimesions'] = 'processing'; $data_widget['filament'] = 'processing'; $data_widget['number_of_layers'] = 'processing'; $data_widget['estimated_time'] = 'processing'; if (is_array($attributes)) { $dimensions = $attributes['dimensions']; $x = number_format($dimensions['x'], 2, '.', ''); $y = number_format($dimensions['y'], 2, '.', ''); $z = number_format($dimensions['z'], 2, '.', ''); $data_widget['dimesions'] = $x . ' x ' . $y . ' x ' . $z . ' mm'; $data_widget['filament'] = number_format($attributes['filament'], 2, '.', '') . ' mm'; $data_widget['number_of_layers'] = $attributes['number_of_layers']; $data_widget['estimated_time'] = $attributes['estimated_time']; } else { if (strtolower($file->file_ext) == '.gc' || strtolower($file->file_ext) == '.gcode' && $file->attributes != 'Processing') { gcode_analyzer($file->id); } } $attr['data-widget-fullscreenbutton'] = 'false'; $attr['data-widget-icon'] = 'fa fa-cube'; $widget_id = 'render_area' . time(); $widget_content = $this->load->view('file/preview/gcode/widget', $data_widget, TRUE); $_widget_preview = widget($widget_id, 'GCode Viewer', $attr, $widget_content, false, false, true); $data['widget'] = $_widget_preview; $data['widget_id'] = $widget_id; $css_in_page = $this->load->view('file/preview/gcode/css', '', TRUE); $js_in_page = $this->load->view('file/preview/gcode/js', $data, TRUE); $this->layout->add_css_in_page(array('data' => $css_in_page, 'comment' => '')); $this->layout->add_js_in_page(array('data' => $js_in_page, 'comment' => '')); $this->layout->set_compress(false); $action .= '/gcode'; } } $this->layout->view('file/' . $action . '/index', $data); }
<?php import('layouts/header', 'เพิ่มรายการ'); widget('topnav'); ?> <div class="container"> <div class="row"> <div class="col-md-9"> <form id="formnew" method="post"> <button type="submit" class="btn btn-default">บันทึก <?php echo date('M m'); ?> </button> <hr /> <div id="n1" class="form-group form-inline"> <select name="n1[]" class="form-control"> <option value="1" selected>รายจ่าย</option> <option value="2">รายรับ</option> </select> <input name="n1[]" type="text" class="form-control" placeholder="ชื่อรายการ" required /> <input name="n1[]" type="number" class="form-control" placeholder="จำนวนเงิน" required/> <input name="n1[]" type="text" class="form-control" placeholder="หมายเหตุ" required/> </div> <input type="hidden" name="csrf_token" value="<?php echo csrf_token(); ?> "> </form> <input type="hidden" id="ncount" value="1"> <hr /> <button id="addnew" class="btn btn-default">เพิ่ม</button>
widget("widget/gallery/gallery.php"); ?> <?php widget("widget/contact/contact.php"); ?> </div> </div><!-- end of scroll --> </div> </div> <!-- end of content --> </div> <!-- 加载组件及对应依赖的js和css --> <?php widget("widget/footer/footer.php"); ?> <!-- 收集style片段以便在顶部输出,style标签可选 --> <?php styleStart(); ?> <style type="text/css"> footer{ margin: *; } </style> <?php styleEnd(); ?>
<?php use yii\helpers\Html; /** * @var yii\base\View $this */ $this->params['breadcrumbs'][] = array('label' => __('config'), 'url' => url('core/config/index')); $this->params['breadcrumbs'][] = $this->title; ?> <?php echo \app\core\widget\Form::widget(array('model' => $model, 'yaml' => "@app/modules/core/forms/config.yaml")); widget('redactor', array('tag' => '#config-body')); ?>
/** * masonry/scroll images * * Example masonry: * * <code> * <?php * widget('masonry' , array('tag'=>'#masonry')); * css(" * #masonry li{ * list-style:none; * float:left; * margin-rigth:10px; * } * "); * ?> * <div id='masonry'> * <ul> * <?php for($j=1;$j<=50;$j++){?> * <?php for($i=1;$i<=6;$i++){?> * <li class='item'> * <?php echo image("upload/t/{$i}.jpg" , array( 'resize' => array(120)));?> * </li> * <?php }?> * <?php }?> * </ul> * </div> * </code> * Example scroll: * <code> * <?php * $data = \application\core\DB::pagination('file'); * $count = $data->pages->itemCount; * $size = $data->pages->pageSize; * $models = $data->models; * widget('masonry' , array( * 'tag'=>'#masonry', * 'scroll'=>true * )); * css(" * #masonry li{ * list-style:none; * float:left; * margin-rigth:10px; * } * "); * ?> * <div id='masonry'> * <ul> * <?php foreach($models as $v){?> * <li class='item'> * <?php echo image($v['path'] , array( 'resize' => array(120)));?> * </li> * <?php }?> * </ul> * </div> *</code> * * Example scroll 2: * * <code> * use application\core\Pagination; * $size = 20; * $arr = Pagination::img($post->img , $size); * $models = $arr['models']; * $pages = $arr['pages']; * $count = $arr['count']; * echo \application\core\Pagination::next($count,$size); * </code> */ function run() { core_js('jquery'); $base = publish(dirname(__FILE__) . '/assets'); $tag = $this->tag; $bottom = $this->bottom ? $this->bottom : true; $itemSelector = $this->itemSelector ? $this->itemSelector : '.item'; if (!$this->options['itemSelector']) { $this->options['itemSelector'] = $itemSelector; } $opts = CJavaScript::encode($this->options); if ($this->scroll === true) { if (true === $this->css) { css_code("\n\t\t\t\t#infscr-loading div{} \n\t\t\t\t\t\t#infscr-loading{clear:both; position: absolute;padding-left:10px;\n\t\t\t\t\t\tbottom: -25px;width: 200px;}#infscr-loading img{float: left;margin-right: 5px;}"); } if (!$this->options['loading']['img']) { $this->options['loading']['img'] = $base . "/ajax-loader.gif"; } if (!$this->options['loading']['msgText']) { $this->options['loading']['msgText'] = __('loading content……'); } if (!$this->options['loading']['finishedMsg']) { $this->options['loading']['finishedMsg'] = __('it is over'); } if (!$this->options['dataType']) { $this->options['dataType'] = 'html'; } if (!$this->options['navSelector']) { $this->options['navSelector'] = 'div.pagination'; } if (!$this->options['nextSelector']) { $this->options['nextSelector'] = 'div.pagination a'; } if (!$this->options['itemSelector']) { $this->options['itemSelector'] = $itemSelector; } $infinitescrollOpts = CJavaScript::encode($this->options); widget("imagesloaded", array('tag' => null)); js_code("\n\t\t\t\tvar \$container = \$('" . $tag . "');\n\t\t \t\t\$container.imagesLoaded(function(){\n\t\t\t \$container.masonry({$opts});\n\t\t\t }); \n\t\t\t\tvar \$container = \$('" . $tag . "');\n\t\t\t\t\t\$container.infinitescroll(" . $infinitescrollOpts . ", \n\t\t\t\t function( newElements ) { \n\t\t\t\t var \$newElems = \$( newElements ).css({ opacity: 0 });\n\t\t\t \$newElems.imagesLoaded(function(){\n\t\t\t \$newElems.animate({ opacity: 1 });\n\t\t\t \$container.masonry( 'applicationended', \$newElems, true ); \n\t\t\t });\n\n\t\t\t\t }\n\t\t\t\t); \n\t\t\t"); js($base . '/jquery.infinitescroll.js'); } else { js_code("\n\t\t\t\tvar \$container = \$('" . $tag . "');\n\t\t \t\t\$container.imagesLoaded(function(){\n\t\t\t \$container.masonry({$opts});\n\t\t\t }); \n\t\t\t"); } js($base . '/jquery.masonry.min.js'); js($base . '/jquery.imagesloaded.min.js'); }
public function index($type = 'additive') { /** INIT DB & MODELS */ $this->load->database(); $this->load->model('objects'); $this->load->model('tasks'); /** * LOAD HELPERS */ $this->load->helper('ft_date_helper'); $this->load->helper('smart_admin_helper'); $this->load->helper('os_helper'); /** LOAD REQUEST PARAMETER */ $_request_obj = $this->input->get('obj'); $_request_file = $this->input->get('file'); /** * check if printer is already printing */ $_task = $this->tasks->get_running('create', 'print'); $_running = $_task ? true : false; if ($_running) { /** GET TASK ATTRIBUTES */ $_attributes = json_decode(file_get_contents($_task['attributes']), TRUE); /** CHECK IF PID IS STILL ALIVE */ if (exist_process($_attributes['pid'])) { $this->load->model('files'); $_object = $this->objects->get_obj_by_id($_attributes['id_object']); $_file = $this->files->get_file_by_id($_attributes['id_file']); if (isset($_attributes['pid']) && $_attributes['pid'] != '') { if (isset($_attributes['monitor']) && $_attributes['monitor'] != '') { $_monitor = file_get_contents($_attributes['monitor']); $_monitor_encoded = json_decode($_monitor); $_stats = json_decode(file_get_contents($_attributes['stats']), TRUE); } } else { $this->tasks->delete($_task['id']); $_running = FALSE; } } else { /** PROCESS IS DEAD */ $_running = false; $this->tasks->delete($_task['id']); } } $data['label'] = $type == 'subtractive' ? 'Mill' : 'Print'; /** * IMPOSTAZIONI STEP1 */ $data_step1['objects'] = $this->objects->get_for_create($type); $_table = $this->load->view('index/step1/table', $data_step1, TRUE); $_widget_table = widget('objects' . time(), 'Objects', '', $_table, false, true, true); $data_step1['_running'] = $_running; $data_step1['_table'] = $_widget_table; //////////////////////////////////////////////////////////////////////////////////////////////////// /** * IMPOSTAZIONI STEP2 */ $data_step2[] = ''; /** * IMPOSTAZIONI STEP4 */ $data_step4 = array(); /** * IMPOSTAZIONI STEP5 */ $data_widget_step5['_progress_percent'] = $_running ? number_format($_monitor_encoded->print->stats->percent, 2, ',', ' ') : '0'; $data_widget_step5['_lines'] = $_running ? $_monitor_encoded->print->lines : '-'; $data_widget_step5['_current_line'] = $_running ? $_monitor_encoded->print->stats->line_number : '-'; $data_widget_step5['_position'] = $_running ? $_monitor_encoded->print->stats->position : '-'; $data_widget_step5['_temperature'] = $_running ? $_monitor_encoded->print->stats->extruder : 0; $data_widget_step5['_temperature_target'] = $_running ? $_monitor_encoded->print->stats->extruder_target : '-'; $data_widget_step5['_bed_temperature'] = $_running ? $_monitor_encoded->print->stats->bed : 0; $data_widget_step5['_bed_temperature_target'] = $_running ? $_monitor_encoded->print->stats->bed_target : '-'; $data_widget_step5['_pid'] = $_running ? $_attributes['pid'] : 0; $data_widget_step5['_velocity'] = $_running && isset($_attributes['speed']) ? $_attributes['speed'] : 100; $data_widget_step5['_rpm'] = $_running && isset($_attributes['rpm']) ? $_attributes['rpm'] : 6000; $data_widget_step5['_running'] = $_running; $data_widget_step5['_file_type'] = $_running ? trim($_file->print_type) : 'additive'; $data_widget_step5['mail'] = $_running && isset($_attributes['mail']) ? $_attributes['mail'] : 0; $data_widget_step5['layer_total'] = $_running ? intval($_monitor_encoded->print->stats->layers->total) : 0; $data_widget_step5['layer_actual'] = $_running ? intval($_monitor_encoded->print->stats->layers->actual) : 0; $data_widget_step5['flow_rate'] = $_running && isset($_attributes['flow_rate']) ? $_attributes['flow_rate'] : 100; $data_widget_step5['fan'] = $_running && isset($_attributes['fan']) ? $_attributes['fan'] : 0; $data_widget_step5['z_override'] = $_running ? $_monitor_encoded->print->stats->z_override : 0; $data_widget_step5['mail'] = $_running && isset($_attributes['mail']) && $_attributes['mail'] == true ? 'checked' : ''; //$data_widget_step5['ext_temp'] = $_running ? $ext_temp : 0; //$data_widget_step5['bed_temp'] = $_running ? $bed_temp : 0; //$data_step5['_tab5_monitor_widget'] = widget('_tab5_monitor_widget', 'Print Monitor', '', $this->load->view('index/step5/widget', $data_widget_step5, TRUE), false); $data_step5['_tab5_monitor_widget'] = $this->load->view('index/step5/widget', $data_widget_step5, TRUE); $data_step5['_running'] = $_running; $data_step5['mail'] = $_running && isset($_attributes['mail']) ? $_attributes['mail'] : 0; /** * * IMPOSTAZIONI STEP6 */ //inclusione dei step $data['_step_1'] = $this->load->view('index/step1/index', $data_step1, TRUE); $data['_step_2'] = $this->load->view('index/step2/index', $data_step2, TRUE); //$data['_step_3'] = $this->load->view('index/step3/index', $data_step3, TRUE); $data['_step_4'] = $this->load->view('index/step4/index', $data_step4, TRUE); $data['_step_5'] = $this->load->view('index/step5/index', $data_step5, TRUE); $data['_step_6'] = $this->load->view('index/step6/index', array('label' => $data['label']), TRUE); $data['_running'] = $_running; $data['_object_name'] = $_running ? ' > ' . $_object->obj_name : ''; $data['_file_name'] = $_running ? ' > ' . $_file->file_name : ''; $data['_file_type'] = $_running ? $_file->print_type : 'additive'; $data_js['_id_task'] = $_running ? $_task['id'] : 0; $data_js['_pid'] = $_running ? $_attributes['pid'] : 0; $data_js['_monitor'] = $_running ? $_monitor : ''; $data_js['_monitor_file'] = $_running ? $_attributes['monitor'] : ''; $data_js['_data_file'] = $_running ? $_attributes['data'] : ''; $data_js['_trace_file'] = $_running ? $_attributes['trace'] : ''; $data_js['_stats_file'] = $_running ? $_attributes['stats'] : ''; $data_js['_folder'] = $_running ? $_attributes['folder'] : ''; $data_js['_debug_file'] = $_running ? $_attributes['debug'] : ''; $data_js['_uri_monitor'] = $_running ? $_attributes['uri_monitor'] : ''; $data_js['_uri_trace'] = $_running ? $_attributes['uri_trace'] : ''; $data_js['_seconds'] = $_running ? time() - intval($_monitor_encoded->print->started) : 0; $data_js['_print_type'] = $_running ? $_attributes['print_type'] : $type; $data_js['progress_percent'] = $data_widget_step5['_progress_percent']; $data_js['print_started'] = $_running ? strtolower($_monitor_encoded->print->print_started) : 'false'; $data_js['layer_total'] = $data_widget_step5['layer_total']; $data_js['layer_actual'] = $data_widget_step5['layer_actual']; $data_js['flow_rate'] = $data_widget_step5['flow_rate']; $data_js['fan'] = $data_widget_step5['fan']; //$data_js['_estimated_time'] = $_running && is_array($_stats) ? 'new Array('.implode(',', $_stats['estimated_time']).')' : 'new Array()'; //$data_js['_progress_steps'] = $_running && is_array($_stats) ? 'new Array('.implode(',', $_stats['progress_steps']).')' : 'new Array()'; $data_js['_estimated_time'] = $_running && is_array($_stats) ? 'FixedQueue(10, [' . implode(',', $_stats['estimated_time']) . '])' : 'FixedQueue(10, [])'; $data_js['_progress_steps'] = $_running && is_array($_stats) ? 'FixedQueue(10, [' . implode(',', $_stats['progress_steps']) . '])' : 'FixedQueue(10, [])'; $data_js['ext_temp'] = $_running ? $_monitor_encoded->print->stats->extruder : 0; $data_js['bed_temp'] = $_running ? $_monitor_encoded->print->stats->bed : 0; $data_js['ext_target'] = $_running ? $_monitor_encoded->print->stats->extruder_target : 0; $data_js['bed_target'] = $_running ? $_monitor_encoded->print->stats->bed_target : 0; $data_js['_velocity'] = $_running && isset($_attributes['speed']) ? $_attributes['speed'] : 100; $data_js['_rpm'] = $_running && isset($_attributes['rpm']) ? $_attributes['rpm'] : 6000; $data_js['_request_obj'] = $_request_obj; $data_js['_request_file'] = $_request_file; $data_js['attributes_file'] = $_running ? $_task['attributes'] : ''; $data_js['z_override'] = $_running ? $_monitor_encoded->print->stats->z_override : 0; $_time = $_running ? time() - intval($_monitor_encoded->print->started) : 0; /** * IMPOSTAZIONI LAYOUT */ $this->layout->add_css_file(array('src' => 'application/modules/create/assets/css/create.css', 'comment' => 'create css')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/fuelux/wizard/wizard.min.js', 'comment' => 'javascript for the wizard')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/datatables/jquery.dataTables.min.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/datatables/dataTables.colVis.min.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/datatables/dataTables.tableTools.min.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/datatables/dataTables.bootstrap.min.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/noUiSlider.7.0.10/jquery.nouislider.all.min.js', 'comment' => 'javascript for the noUISlider')); $this->layout->add_css_file(array('src' => 'application/layout/assets/js/plugin/noUiSlider.7.0.10/jquery.nouislider.min.css', 'comment' => 'javascript for the noUISlider')); $this->layout->add_css_file(array('src' => 'application/layout/assets/js/plugin/noUiSlider.7.0.10/jquery.nouislider.pips.min.css', 'comment' => 'javascript for the noUISlider')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/bootstrap-progressbar/bootstrap-progressbar.min.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/fixed_queue.js', 'comment' => '')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/knob/jquery.knob.min.js', 'comment' => 'KNOB')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/ace/src-min/ace.js', 'comment' => 'ACE EDITOR JAVASCRIPT')); $this->layout->add_js_file(array('src' => 'application/modules/create/assets/js/utilities.js', 'comment' => 'create utilities')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/flot/jquery.flot.cust.min.js', 'comment' => 'create utilities')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/flot/jquery.flot.resize.min.js', 'comment' => 'create utilities')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/flot/jquery.flot.fillbetween.min.js', 'comment' => 'create utilities')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/flot/jquery.flot.orderBar.min.js', 'comment' => 'create utilities')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/flot/jquery.flot.pie.min.js', 'comment' => 'create utilities')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/flot/jquery.flot.time.min.js', 'comment' => 'create utilities')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/flot/jquery.flot.tooltip.min.js', 'comment' => 'create utilities')); $this->layout->add_js_file(array('src' => 'application/layout/assets/js/plugin/flot/jquery.flot.axislabels.js', 'comment' => 'create utilities')); $js_in_page = $this->load->view('index/js', $data_js, TRUE); $this->layout->add_js_in_page(array('data' => $js_in_page, 'comment' => 'create module')); $this->layout->set_compress(false); $this->layout->view('index/index', $data); }
<!-- Divider --> <div class="row"> <div class="12u"> <div class="divider divider-top"></div> </div> </div> <!-- Highlight Box --> <div class="row"> <div class="12u"> <div class="highlight-box"> <?php widget('highlight'); ?> </div> </div> </div> <!-- Divider --> <div class="row"> <div class="12u"> <div class="divider divider-top"></div> </div>
<div class="btn-order-call"> <button data-tab="true" data-drop="#ordercall" data-source="<?php echo site_url('shop/callback'); ?> "> <span class="icon_order_call"></span> <span class="text-el d_l"><?php echo lang('Заказать звонок', 'lightVertical'); ?> </span> </button> </div> </div> <div class="head-work"> <?php echo widget('work'); ?> </div> <!-- End. Contacts block--> <div class="frame-search-cleaner"> <!-- Start. Include cart data template--> <!-- End. Include cart data template--> <!-- Start. Show search form--> <div class="frame-search-form"> <div class="p_r"> <form name="search" method="get" action="<?php echo shop_url('search'); ?> "> <span class="btn-search">