当前位置: 首页>>代码示例>>PHP>>正文


PHP SiteHelpers::CF_decode_json方法代码示例

本文整理汇总了PHP中SiteHelpers::CF_decode_json方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteHelpers::CF_decode_json方法的具体用法?PHP SiteHelpers::CF_decode_json怎么用?PHP SiteHelpers::CF_decode_json使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SiteHelpers的用法示例。


在下文中一共展示了SiteHelpers::CF_decode_json方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: makeInfo

 static function makeInfo($id)
 {
     $row = \DB::table('tb_module')->where('module_name', $id)->get();
     $data = array();
     foreach ($row as $r) {
         $data['id'] = $r->module_id;
         $data['title'] = $r->module_title;
         $data['note'] = $r->module_note;
         $data['table'] = $r->module_db;
         $data['key'] = $r->module_db_key;
         $data['config'] = \SiteHelpers::CF_decode_json($r->module_config);
         $field = array();
         foreach ($data['config']['grid'] as $fs) {
             foreach ($fs as $f) {
                 $field[] = $fs['field'];
             }
         }
         $data['field'] = $field;
     }
     return $data;
 }
开发者ID:vinodjoshi,项目名称:laravel,代码行数:21,代码来源:Sximo.php

示例2: makeInfo

 static function makeInfo($id)
 {
     $row = \DB::table('tb_module')->where('module_name', $id)->get();
     $data = array();
     foreach ($row as $r) {
         $langs = json_decode($r->module_lang, true);
         $data['id'] = $r->module_id;
         $data['title'] = \SiteHelpers::infoLang($r->module_title, $langs, 'title');
         $data['note'] = \SiteHelpers::infoLang($r->module_note, $langs, 'note');
         $data['table'] = $r->module_db;
         $data['key'] = $r->module_db_key;
         $data['config'] = \SiteHelpers::CF_decode_json($r->module_config);
         $field = array();
         foreach ($data['config']['grid'] as $fs) {
             foreach ($fs as $f) {
                 $field[] = $fs['field'];
             }
         }
         $data['field'] = $field;
         $data['setting'] = array('gridtype' => isset($data['config']['setting']['gridtype']) ? $data['config']['setting']['gridtype'] : 'native', 'orderby' => isset($data['config']['setting']['orderby']) ? $data['config']['setting']['orderby'] : $r->module_db_key, 'ordertype' => isset($data['config']['setting']['ordertype']) ? $data['config']['setting']['ordertype'] : 'asc', 'perpage' => isset($data['config']['setting']['perpage']) ? $data['config']['setting']['perpage'] : '10', 'frozen' => isset($data['config']['setting']['frozen']) ? $data['config']['setting']['frozen'] : 'false', 'form-method' => isset($data['config']['setting']['form-method']) ? $data['config']['setting']['form-method'] : 'native', 'view-method' => isset($data['config']['setting']['view-method']) ? $data['config']['setting']['view-method'] : 'native', 'inline' => isset($data['config']['setting']['inline']) ? $data['config']['setting']['inline'] : 'false');
     }
     return $data;
 }
开发者ID:vtvmd2015,项目名称:symtec,代码行数:23,代码来源:Sximo.php

示例3: getRebuild

 public function getRebuild(Request $request, $id = 0)
 {
     $row = \DB::table('tb_module')->where('module_id', $id)->get();
     if (count($row) <= 0) {
         return Redirect::to('sximo/module')->with('messagetext', 'Can not find module')->with('msgstatus', 'error');
     }
     $row = $row[0];
     $this->data['row'] = $row;
     $config = \SiteHelpers::CF_decode_json($row->module_config);
     $class = $row->module_name;
     $ctr = ucwords($row->module_name);
     $path = $row->module_name;
     // build Field entry
     $f = '';
     $req = '';
     // End Build Field Entry
     $codes = array('controller' => ucwords($class), 'class' => $class, 'fields' => $f, 'required' => $req, 'table' => $row->module_db, 'title' => $row->module_title, 'note' => $row->module_note, 'key' => $row->module_db_key, 'sql_select' => $config['sql_select'], 'sql_where' => $config['sql_where'], 'sql_group' => $config['sql_group']);
     if (!isset($config['form_layout'])) {
         $config['form_layout'] = array('column' => 1, 'title' => $row->module_title, 'format' => 'grid', 'display' => 'horizontal');
     }
     $codes['form_javascript'] = \SiteHelpers::toJavascript($config['forms'], $path, $class);
     $codes['form_entry'] = \SiteHelpers::toForm($config['forms'], $config['form_layout']);
     $codes['form_display'] = isset($config['form_layout']['display']) ? $config['form_layout']['display'] : 'horizontal';
     $codes['form_view'] = \SiteHelpers::toView($config['grid']);
     $codes['masterdetailmodel'] = '';
     $codes['masterdetailinfo'] = '';
     $codes['masterdetailgrid'] = '';
     $codes['masterdetailsave'] = '';
     $codes['masterdetailform'] = '';
     $codes['masterdetailview'] = '';
     $codes['masterdetailjs'] = '';
     $codes['masterdetaildelete'] = '';
     /* Master detail */
     if (isset($config['subgrid']) && count($config['subgrid']) >= 1) {
         $md = \SiteHelpers::toMasterDetail($config['subgrid'][0]);
         $codes['masterdetailmodel'] = $md['masterdetailmodel'];
         $codes['masterdetailinfo'] = $md['masterdetailinfo'];
         $codes['masterdetailgrid'] = $md['masterdetailgrid'];
         $codes['masterdetailsave'] = $md['masterdetailsave'];
         $codes['masterdetailform'] = $md['masterdetailform'];
         $codes['masterdetailjs'] = $md['masterdetailjs'];
         $codes['masterdetailview'] = $md['masterdetailview'];
         $codes['masterdetaildelete'] = $md['masterdetaildelete'];
     }
     /* End Master Detail */
     $dir = base_path() . '/resources/views/' . $class;
     $dirC = app_path() . '/Http/Controllers/';
     $dirM = app_path() . '/Models/';
     if (!is_dir($dir)) {
         mkdir($dir, 0777);
     }
     // BLANK TEMPLATE
     if ($row->module_type == 'generic') {
         $template = base_path() . '/resources/views/sximo/module/template/blank/';
         $controller = file_get_contents($template . 'controller.tpl');
         $grid = file_get_contents($template . 'grid.tpl');
         $view = file_get_contents($template . 'view.tpl');
         $form = file_get_contents($template . 'form.tpl');
         $model = file_get_contents($template . 'model.tpl');
         $build_controller = \SiteHelpers::blend($controller, $codes);
         $build_view = \SiteHelpers::blend($view, $codes);
         $build_form = \SiteHelpers::blend($form, $codes);
         $build_grid = \SiteHelpers::blend($grid, $codes);
         $build_model = \SiteHelpers::blend($model, $codes);
         file_put_contents($dirC . "{$ctr}Controller.php", $build_controller);
         file_put_contents($dirM . "{$ctr}.php", $build_model);
         file_put_contents($dir . "/index.blade.php", $build_grid);
         file_put_contents($dir . "/form.blade.php", $build_form);
         file_put_contents($dir . "/view.blade.php", $build_view);
     }
     if ($row->module_type == 'report') {
         $template = base_path() . '/resources/views/sximo/module/template/report/';
         $controller = file_get_contents($template . 'controller.tpl');
         $grid = file_get_contents($template . 'grid.tpl');
         $model = file_get_contents($template . 'model.tpl');
         $build_controller = \SiteHelpers::blend($controller, $codes);
         $build_grid = \SiteHelpers::blend($grid, $codes);
         $build_model = \SiteHelpers::blend($model, $codes);
         file_put_contents($dirC . "{$ctr}Controller.php", $build_controller);
         file_put_contents($dirM . "{$ctr}.php", $build_model);
         file_put_contents($dir . "/index.blade.php", $build_grid);
     }
     if ($row->module_type == 'addon') {
         $template = base_path() . '/resources/views/sximo/module/template/native/';
         $controller = file_get_contents($template . 'controller.tpl');
         $grid = file_get_contents($template . 'grid.tpl');
         $view = file_get_contents($template . 'view.tpl');
         $form = file_get_contents($template . 'form.tpl');
         $model = file_get_contents($template . 'model.tpl');
         $build_controller = \SiteHelpers::blend($controller, $codes);
         $build_view = \SiteHelpers::blend($view, $codes);
         $build_form = \SiteHelpers::blend($form, $codes);
         $build_grid = \SiteHelpers::blend($grid, $codes);
         $build_model = \SiteHelpers::blend($model, $codes);
         if (!is_null($request->input('rebuild'))) {
             // rebuild spesific files
             if ($request->input('c') == 'y') {
                 file_put_contents($dirC . "{$ctr}Controller.php", $build_controller);
             }
             if ($request->input('m') == 'y') {
//.........这里部分代码省略.........
开发者ID:alvarobfdev,项目名称:applog,代码行数:101,代码来源:ModuleController.php

示例4:

@extends('frontend.index')
@section('content')
<?php 
$categories = SiteHelpers::mainCategory('category');
$currentRoute = Route::current();
$parameters = $currentRoute->parameters();
if ($parameters) {
    $cat = SiteHelpers::CF_decode_json($parameters['one']);
    if (is_array($cat)) {
        $pollNext[0] = $cat[0];
        $pollNext[1] = $cat[1];
    } else {
        $pollNext[0] = $cat;
        $pollNext[1] = '';
    }
} else {
    $pollNext[0] = '';
    $pollNext[1] = '';
}
// echo "<pre>";print_r($polls);die;
if (isset($polls)) {
    $pollNext[2] = $polls->pk_poll_id;
} else {
    $pollNext[2] = '';
}
$nextPollArr = SiteHelpers::CF_encode_json($pollNext);
?>
<div class="main-banner m-none">
<img src="{{ URL::asset('images/banner-main.jpg') }}" alt="">
<!--main-banner --></div>
开发者ID:Yashwanth1,项目名称:aregudam,代码行数:30,代码来源:home.blade.php

示例5: getRemovesub

 function getRemovesub()
 {
     $id = Input::get('id');
     $module = Input::get('mod');
     $row = DB::table('tb_module')->where('module_id', $id)->get();
     if (count($row) <= 0) {
         return Redirect::to($this->module)->with('messagetext', 'Can not find module')->with('msgstatus', 'error');
     }
     $row = $row[0];
     $this->data['row'] = $row;
     $config = SiteHelpers::CF_decode_json($row->module_config);
     $subgrid = array();
     foreach ($config['subgrid'] as $sb) {
         if ($sb['module'] != $module) {
             $subgrid[] = $sb;
         }
     }
     unset($config["subgrid"]);
     $new_config = array_merge($config, array("subgrid" => $subgrid));
     //echo '<pre>'; print_r($new_config); echo '</pre>'; exit;
     $affected = DB::table('tb_module')->where('module_id', '=', $id)->update(array('module_config' => SiteHelpers::CF_encode_json($new_config)));
     return Redirect::to($this->module . '/sub/' . $row->module_name)->with('messagetext', 'Master Has removed Successful.')->with('msgstatus', 'success');
 }
开发者ID:buguelos,项目名称:make,代码行数:23,代码来源:ModuleController.php

示例6: rebuild

 function rebuild($id = 0)
 {
     $row = $this->db->get_where('tb_module', array('module_id' => $id))->row();
     if (count($row) <= 0) {
         redirect('sximo/module', 301);
     }
     $this->data['row'] = $row;
     $config = SiteHelpers::CF_decode_json($row->module_config);
     $class = $row->module_name;
     $ctr = ucwords($row->module_name);
     $path = $row->module_name;
     // build Field entry
     $f = '';
     $req = '';
     $codes = array('controller' => ucwords($class), 'class' => $class, 'fields' => $f, 'required' => $req, 'table' => $row->module_db, 'title' => $row->module_title, 'note' => $row->module_note, 'key' => $row->module_db_key, 'sql_select' => $config['sql_select'], 'sql_where' => $config['sql_where'], 'sql_group' => $config['sql_group']);
     if (!isset($config['form_layout'])) {
         $config['form_layout'] = array('column' => 1, 'title' => $row->module_title, 'format' => 'grid', 'display' => 'horizontal');
     }
     $codes['form_javascript'] = SiteHelpers::toJavascript($config['forms'], $path, $class);
     $codes['form_entry'] = SiteHelpers::toForm($config['forms'], $config['form_layout']);
     $codes['form_display'] = isset($config['form_layout']['display']) ? $config['form_layout']['display'] : 'horizontal';
     $codes['form_view'] = SiteHelpers::toView($config['grid']);
     // Start Native CRUD
     if ($row->module_db_key == '') {
         // No CRUD
         $controller = file_get_contents('application/views/sximo/module/template/controller_view.tpl');
         $grid = file_get_contents('application/views/sximo/module/template/index_view.tpl');
     } else {
         $controller = file_get_contents('application/views/sximo/module/template/controller.tpl');
         $grid = file_get_contents('application/views/sximo/module/template/index.tpl');
     }
     $view = file_get_contents('application/views/sximo/module/template/view.tpl');
     $form = file_get_contents('application/views/sximo/module/template/form.tpl');
     $model = file_get_contents('application/views/sximo/module/template/model.tpl');
     $build_controller = SiteHelpers::blend($controller, $codes);
     $build_view = SiteHelpers::blend($view, $codes);
     $build_form = SiteHelpers::blend($form, $codes);
     $build_grid = SiteHelpers::blend($grid, $codes);
     $build_model = SiteHelpers::blend($model, $codes);
     if (!is_dir("application/views/{$class}")) {
         mkdir("application/views/{$class}", 0777);
     }
     if ($this->input->get('rebuild') != '') {
         // rebuild spesific files
         if ($this->input->get('c') == 'y') {
             file_put_contents("application/controllers/{$class}.php", $build_controller);
         }
         if ($this->input->get('m') == 'y') {
             file_put_contents("application/models/{$class}model.php", $build_model);
         }
         if ($this->input->get('g') == 'y') {
             file_put_contents("application/views/{$class}/index.php", $build_grid);
         }
         if ($row->module_db_key != '') {
             if ($this->input->get('f') == 'y') {
                 file_put_contents("application/views/{$class}/form.php", $build_form);
             }
             if ($this->input->get('v') == 'y') {
                 file_put_contents("application/views/{$class}/view.php", $build_view);
             }
         }
     } else {
         file_put_contents("application/controllers/{$class}.php", $build_controller);
         file_put_contents("application/models/{$class}model.php", $build_model);
         file_put_contents("application/views/{$class}/index.php", $build_grid);
         if ($row->module_db_key != '') {
             file_put_contents("application/views/{$class}/form.php", $build_form);
             file_put_contents("application/views/{$class}/view.php", $build_view);
         }
     }
     $this->session->set_flashdata('message', SiteHelpers::alert('success', 'Code Script has been replaced successfull'));
     redirect('sximo/module', 301);
 }
开发者ID:HRVConsultores,项目名称:elearning,代码行数:73,代码来源:module.php

示例7: getPoll

 public function getPoll($params)
 {
     $param = \SiteHelpers::CF_decode_json($params);
     $getData = \PollHelpers::pollSingle($param);
     return view('frontend.viewall', $getData)->render();
 }
开发者ID:Yashwanth1,项目名称:aregudam,代码行数:6,代码来源:LoginController.php

示例8: makeInfo

 function makeInfo($id)
 {
     $query = $this->db->get_where('tb_module', array('module_name' => $id));
     $data = array();
     foreach ($query->result() as $r) {
         $data['id'] = $r->module_id;
         $data['title'] = $r->module_title;
         $data['note'] = $r->module_note;
         $data['table'] = $r->module_db;
         $data['key'] = $r->module_db_key;
         $data['config'] = SiteHelpers::CF_decode_json($r->module_config);
         $field = array();
         foreach ($data['config']['grid'] as $fs) {
             foreach ($fs as $f) {
                 $field[] = $fs['field'];
             }
         }
         $data['field'] = $field;
     }
     $query->free_result();
     return $data;
 }
开发者ID:HRVConsultores,项目名称:elearning,代码行数:22,代码来源:SB_Model.php

示例9: postSavepermission

 function postSavepermission()
 {
     $id = Input::get('module_id');
     $row = DB::table('tb_module')->where('module_id', $id)->get();
     if (count($row) <= 0) {
         return Redirect::to($this->module)->with('message', SiteHelpers::alert('error', 'Can not find module'));
     }
     $row = $row[0];
     $this->data['row'] = $row;
     $config = SiteHelpers::CF_decode_json($row->module_config);
     $tasks = array('is_global' => 'Global ', 'is_view' => 'View ', 'is_detail' => 'Detail', 'is_add' => 'Add ', 'is_edit' => 'Edit ', 'is_remove' => 'Remove ', 'is_excel' => 'Excel ');
     /* Update permission global / own access new ver 1.1
        Adding new param is_global
        End Update permission global / own access new ver 1.1
        */
     if (isset($config['tasks'])) {
         foreach ($config['tasks'] as $row) {
             $tasks[$row['item']] = $row['title'];
         }
     }
     $permission = array();
     $groupID = Input::get('group_id');
     for ($i = 0; $i < count($groupID); $i++) {
         // remove current group_access
         $group_id = $groupID[$i];
         DB::table('tb_groups_access')->where('module_id', '=', Input::get('module_id'))->where('group_id', '=', $group_id)->delete();
         $arr = array();
         $id = $groupID[$i];
         foreach ($tasks as $t => $v) {
             $arr[$t] = isset($_POST[$t][$id]) ? "1" : "0";
         }
         $permissions = json_encode($arr);
         $data = array("access_data" => $permissions, "module_id" => Input::get('module_id'), "group_id" => $groupID[$i]);
         DB::table('tb_groups_access')->insert($data);
     }
     return Redirect::to($this->module . '/config/' . $row->module_name)->with('message', SiteHelpers::alert('success', Lang::get('core.permission_note_success')));
     return Redirect::to('module')->with('message', SiteHelpers::alert('error', ' Feature disabled on demo page '));
 }
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:38,代码来源:PermissionController.php

示例10: getSub

 function getSub($id = '')
 {
     /*if($this->authValid['status'] =='error')
     		{
     			$this->data['message'] = $this->authValid['message'];
     			$this->data['status'] = $this->authValid['status'];
     			$this->layout->nest('content','admin.module.Login',$this->data); 
     		 }	 else {*/
     $row = DB::table('tb_module')->where('module_name', $id)->get();
     if (count($row) <= 0) {
         return Redirect::to($this->module)->with('message', SiteHelpers::alert('error', 'Can not find module'));
     }
     $row = $row[0];
     $config = SiteHelpers::CF_decode_json($row->module_config);
     $this->data['row'] = $row;
     $this->data['fields'] = $config['grid'];
     $this->data['subs'] = isset($config['subgrid']) ? $config['subgrid'] : array();
     $this->data['tables'] = Module::getTableList($this->db);
     $this->data['module'] = $this->module;
     $this->data['module_name'] = $id;
     $this->data['modules'] = Module::all();
     $this->layout->nest('content', 'admin.module.ConfigSub', $this->data)->with('menus', SiteHelpers::menus());
 }
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:23,代码来源:ModuleController.php


注:本文中的SiteHelpers::CF_decode_json方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。