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


PHP SiteHelpers::langOption方法代码示例

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


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

示例1: save

 function save($id = 0)
 {
     $rules = array(array('field' => 'menu_name', 'label' => 'Menu Name', 'rules' => 'required'), array('field' => 'active', 'label' => 'Active', 'rules' => 'required'), array('field' => 'menu_type', 'label' => 'Menu Type', 'rules' => 'required'), array('field' => 'position', 'label' => 'Position', 'rules' => 'required'));
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run()) {
         $pos = $this->input->post('position', true);
         $data = $this->validatePost('tb_menu');
         if (CNF_MULTILANG == 1) {
             $lang = SiteHelpers::langOption();
             $language = array();
             foreach ($lang as $l) {
                 if ($l['folder'] != 'en') {
                     $menu_lang = isset($_POST['language_title'][$l['folder']]) ? $_POST['language_title'][$l['folder']] : '';
                     $language['title'][$l['folder']] = $menu_lang;
                 }
             }
             $data['menu_lang'] = json_encode($language);
         }
         $arr = array();
         $groups = $this->db->get('tb_groups')->result();
         foreach ($groups as $g) {
             $arr[$g->group_id] = isset($_POST['groups'][$g->group_id]) ? "1" : "0";
         }
         $data['access_data'] = json_encode($arr);
         $data['allow_guest'] = isset($_POST['allow_guest']) ? '1' : '0';
         //echo '<pre>';print_r($data);echo '</pre>';exit;
         unset($data['ordering']);
         $this->model->insertRow($data, $this->input->post('menu_id'));
         redirect('sximo/menu?pos=' . $pos);
     } else {
         redirect('sximo/menu?pos=' . $pos);
     }
 }
开发者ID:HRVConsultores,项目名称:elearning,代码行数:33,代码来源:menu.php

示例2: postSave

 function postSave(Request $request, $id = 0)
 {
     $rules = array('menu_name' => 'required', 'active' => 'required', 'menu_type' => 'required', 'position' => 'required');
     $validator = Validator::make($request->all(), $rules);
     if ($validator->passes()) {
         $pos = $request->input('position');
         $data = $this->validatePost('tb_menu');
         if (CNF_MULTILANG == 1) {
             $lang = \SiteHelpers::langOption();
             $language = array();
             foreach ($lang as $l) {
                 if ($l['folder'] != 'en') {
                     $menu_lang = isset($_POST['language_title'][$l['folder']]) ? $_POST['language_title'][$l['folder']] : '';
                     $language['title'][$l['folder']] = $menu_lang;
                 }
             }
             $data['menu_lang'] = json_encode($language);
         }
         $arr = array();
         $groups = \DB::table('tb_groups')->get();
         foreach ($groups as $g) {
             $arr[$g->group_id] = isset($_POST['groups'][$g->group_id]) ? "1" : "0";
         }
         $data['access_data'] = json_encode($arr);
         $data['allow_guest'] = $request->input('allow_guest');
         $this->model->insertRow($data, $request->input('menu_id'));
         return Redirect::to('sximo/menu?pos=' . $pos)->with('messagetext', 'Data Has Been Save Successfull')->with('msgstatus', 'success');
     } else {
         return Redirect::to('sximo/menu?pos=' . $pos)->with('messagetext', 'The following errors occurred')->with('msgstatus', 'error')->withErrors($validator)->withInput();
     }
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:31,代码来源:MenuController.php

示例3: postSavetable

 public function postSavetable(Request $request)
 {
     //$this->beforeFilter('csrf', array('on'=>'post'));
     $id = $request->input('module_id');
     $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];
     $config = \SiteHelpers::CF_decode_json($row->module_config);
     $lang = \SiteHelpers::langOption();
     $grid = array();
     $total = count($_POST['field']);
     extract($_POST);
     for ($i = 1; $i <= $total; $i++) {
         $language = array();
         $grid[] = array('field' => $field[$i], 'alias' => $alias[$i], 'language' => $language, 'label' => $label[$i], 'view' => isset($view[$i]) ? 1 : 0, 'detail' => isset($detail[$i]) ? 1 : 0, 'sortable' => isset($sortable[$i]) ? 1 : 0, 'search' => isset($search[$i]) ? 1 : 0, 'download' => isset($download[$i]) ? 1 : 0, 'frozen' => isset($frozen[$i]) ? 1 : 0, 'limited' => isset($limited[$i]) ? $limited[$i] : '', 'width' => $width[$i], 'align' => $align[$i], 'sortlist' => $sortlist[$i], 'conn' => array('valid' => $conn_valid[$i], 'db' => $conn_db[$i], 'key' => $conn_key[$i], 'display' => $conn_display[$i]), 'attribute' => array('hyperlink' => array('active' => isset($attr_link_active[$i]) ? 1 : 0, 'link' => $attr_link[$i], 'target' => $attr_target[$i], 'html' => $attr_link_html[$i]), 'image' => array('active' => isset($attr_image_active[$i]) ? 1 : 0, 'path' => $attr_image[$i], 'size_x' => $attr_image_width[$i], 'size_y' => $attr_image_height[$i], 'html' => $attr_image_html[$i])));
     }
     unset($config["grid"]);
     $new_config = array_merge($config, array("grid" => $grid));
     $data['module_config'] = \SiteHelpers::CF_encode_json($new_config);
     // echo '<pre>'; print_r($new_config); echo '</pre>';    exit;
     \DB::table('tb_module')->where('module_id', '=', $id)->update(array('module_config' => \SiteHelpers::CF_encode_json($new_config)));
     return Redirect::to('sximo/module/table/' . $row->module_name)->with('messagetext', 'Module Table Has Been Save Successfull')->with('msgstatus', 'success');
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:25,代码来源:ModuleController.php

示例4: foreach

    ?>
</td>
            <td>
				<div class="input-group input-group-sm">
				<span class="input-group-addon xlick bg-default btn-xs " >EN</span>		
				<input type="text" name="label[<?php 
    echo $id;
    ?>
]" class="form-control input-sm" value="<?php 
    echo $rows['label'];
    ?>
" />
				
              </div>
			  <?php 
    $lang = SiteHelpers::langOption();
    if (CNF_MULTILANG == 1) {
        foreach ($lang as $l) {
            if ($l['folder'] != 'en') {
                ?>
			   <div class="input-group input-group-sm" style="margin:1px 0 !important;">
			   		<span class="input-group-addon xlick bg-default btn-sm " ><?php 
                echo strtoupper($l['folder']);
                ?>
</span>
			  	 <input name="language[<?php 
                echo $id;
                ?>
][<?php 
                echo $l['folder'];
                ?>
开发者ID:sonoftheweb,项目名称:yallatracking_app,代码行数:31,代码来源:form.blade.php

示例5: foreach

<div class="row  ">
	<nav style="margin-bottom: 0;" role="navigation" class="navbar navbar-static-top gray-bg">
	<div class="navbar-header">
		<a href="javascript:void(0)" class="navbar-minimalize minimalize-btn btn btn-primary "><i class="fa fa-bars"></i> </a>			
	</div>
	
	
	 <ul class="nav navbar-top-links navbar-right">
		<?php 
if (CNF_MULTILANG == 1) {
    ?>
		<li  class="user dropdown"><a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-flag"></i><i class="caret"></i></a>
			 <ul class="dropdown-menu dropdown-menu-right icons-right">
				<?php 
    foreach (SiteHelpers::langOption() as $lang) {
        ?>
					<li><a href="<?php 
        echo site_url('page/lang/' . $lang['folder']);
        ?>
"><i class="fa fa-flag"></i> <?php 
        echo $lang['name'];
        ?>
</a></li>
				<?php 
    }
    ?>
	
			</ul>
		</li>	
		<?php 
}
开发者ID:HRVConsultores,项目名称:elearning,代码行数:31,代码来源:headmenu.php

示例6: postSaveform

 function postSaveform()
 {
     $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('messagetext', 'Can not find module')->with('msgstatus', 'error');
     }
     $row = $row[0];
     $this->data['row'] = $row;
     $config = SiteHelpers::CF_decode_json($row->module_config);
     $lang = SiteHelpers::langOption();
     $this->data['tables'] = $config['grid'];
     $total = count($_POST['field']);
     extract($_POST);
     $f = array();
     for ($i = 1; $i <= $total; $i++) {
         $language = array();
         $f[] = array("field" => $field[$i], "alias" => $alias[$i], "language" => $language, "label" => $label[$i], 'form_group' => $form_group[$i], 'required' => isset($required[$i]) ? $required[$i] : 0, 'view' => isset($view[$i]) ? 1 : 0, 'type' => $type[$i], 'add' => 1, 'size' => '0', 'edit' => 1, 'search' => isset($search[$i]) ? $search[$i] : 0, "sortlist" => $sortlist[$i], 'option' => array("opt_type" => $opt_type[$i], "lookup_query" => $lookup_query[$i], "lookup_table" => $lookup_table[$i], "lookup_key" => $lookup_key[$i], "lookup_value" => $lookup_value[$i], 'is_dependency' => $is_dependency[$i], 'is_multiple' => isset($is_multiple[$i]) ? $is_multiple[$i] : 0, 'lookup_dependency_key' => $lookup_dependency_key[$i], 'path_to_upload' => $path_to_upload[$i], 'resize_width' => $resize_width[$i], 'resize_height' => $resize_height[$i], 'upload_type' => $upload_type[$i], 'tooltip' => $tooltip[$i], 'attribute' => $attribute[$i], 'extend_class' => $extend_class[$i]));
     }
     unset($config["forms"]);
     $new_config = array_merge($config, array("forms" => $f));
     $data['module_config'] = SiteHelpers::CF_encode_json($new_config);
     //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 . '/form/' . $row->module_name)->with('messagetext', 'Module Forms Has Changed Successful.')->with('msgstatus', 'success');
 }
开发者ID:buguelos,项目名称:make,代码行数:26,代码来源:ModuleController.php


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