Пример #1
0
 public function show($slug, $id)
 {
     $cat = $this->cat->show($id, current_lang());
     $cat_ids = $cat->all_ids();
     $data = ['cat' => $cat, 'posts' => $this->post->get_by_catids($cat_ids)];
     return view('frontend.category', $data);
 }
Пример #2
0
 public function show($id, $lang = null)
 {
     $lang = $lang ? $lang : current_lang();
     $item = $this->find($id);
     $item->desc = $item->langs()->where('code', $lang)->first()->pivot;
     return $item;
 }
Пример #3
0
 public function getLast($number, $lang = null, $columns = ['*'])
 {
     $lang = $lang ? $lang : current_lang();
     return $this->model->with(['langs' => function ($q) use($lang) {
         $q->where('code', $lang);
         $q->select('services_lang.*');
     }])->orderBy('created_at', 'desc')->take($number)->get($columns);
 }
Пример #4
0
 public function show($id)
 {
     $group = $this->menugroup->find($id);
     $args = ['orderby' => 'order', 'order' => 'asc'];
     $items = $this->menu->all($id, current_lang(), $args);
     $data = ['title' => 'Quản lý Menu', 'group' => $group, 'editMenus' => $this->menu->editBackendMenu($items)];
     return view('backend.menu.index', $data);
 }
Пример #5
0
 public function getAllType($type = 'cat', $lang = null)
 {
     $lang = $lang ? $lang : current_lang();
     return $this->model->where('type', $type)->with(['langs' => function ($query) use($lang) {
         $query->where('code', $lang);
         $query->select('cat_desc.*');
     }])->orderBy('order')->paginate(20);
 }
Пример #6
0
Файл: Tax.php Проект: huudo/bds1
 public function getParent($field)
 {
     $item = $this->prent()->first(['id']);
     if (is_null($item)) {
         return 'none';
     }
     return $item->langs()->where('code', current_lang())->first(['id'])->pivot->{$field};
 }
Пример #7
0
 public function getByGroup($menu_id, $lang = null)
 {
     $lang = $lang ? $lang : current_lang();
     return $this->model->where('group_id', $menu_id)->with(['langs' => function ($q) use($lang) {
         $q->where('code', $lang);
         $q->select('menu_desc.*');
     }])->orderBy('order')->get();
 }
Пример #8
0
 public function edit($id)
 {
     $item = $this->room->getEdit($id);
     $convs = $this->roomtype->all('roomconv', current_lang());
     $currconvs = $item->convenients()->lists('id')->toArray();
     $data = ['title' => 'Cập nhật phòng', 'roomtypes' => [0 => 'Loại phòng'] + $this->roomtype->listType('roomtype', 0, true, current_lang()), 'hotels' => [0 => 'Chọn khách sạn'] + $this->hotel->listAll(true, current_lang()), 'item' => $item, 'convs' => $this->roomtype->cat_checklists($convs, 0, $currconvs)];
     return view('backend.room.edit', $data);
 }
Пример #9
0
 public function edit($id)
 {
     $hotel = $this->hotel->getEdit($id);
     $convs = $this->tax->all('hotelconv', current_lang());
     $curconvs = $hotel->convenients()->lists('id')->toArray();
     $data = ['title' => 'Cập nhật khách sạn', 'countries' => $this->country->all(current_lang(), ['columns' => ['id']]), 'item' => $hotel, 'convs' => $this->tax->cat_checklists($convs, 0, $curconvs)];
     return view('backend.hotel.edit', $data);
 }
Пример #10
0
 public function show($id)
 {
     $group = $this->slider->find($id);
     $args = ['orderby' => 'order', 'order' => 'asc'];
     $items = $this->slide->getByGroup($id, current_lang(), $args);
     $data = ['title' => 'Quản lý Slide', 'group' => $group, 'items' => $items];
     return view('backend.slide.index', $data);
 }
Пример #11
0
 public function findLang($id, $lang = null)
 {
     $lang = $lang ? current_lang() : $lang;
     $item = $this->model->find($id);
     if (is_null($item)) {
         throw new NullException('null', 'Không thấy dữ liệu');
     }
     return $item;
 }
Пример #12
0
 /**
  * Changing site language
  *
  * @access   public
  * @param    string
  * @return   void
  */
 public function lang($code = false)
 {
     $code or $code = current_lang('code');
     $url = $this->input->get('redirect', true);
     $url or $url = site_url();
     $this->i18n->change($code);
     redirect($url);
     exit;
 }
Пример #13
0
 public function show($slug, $id)
 {
     //Tăng view
     $post = Post::find($id);
     $post->views++;
     $post->save();
     $data = ['post' => $this->post->show($id, current_lang())];
     return view('frontend.post', $data);
 }
Пример #14
0
 public function edit($id)
 {
     $cats = $this->tax->all('cat', current_lang());
     $post = $this->post->getEdit($id);
     authorize_other('edit_posts', 'edit_others_posts', $post->author_id);
     $currcats = $post->cats()->lists('id')->toArray();
     $data = ['title' => 'Cập nhật bài viết', 'cat_checklists' => $this->tax->cat_checklists($cats, 0, $currcats), 'availtags' => $this->tax->listType('tag'), 'currtags' => $post->tags()->lists('id')->toArray(), 'item' => $post];
     return view('backend.post.edit', $data);
 }
Пример #15
0
 public function testLang()
 {
     $current_lang = current_lang();
     set_current_lang('bg');
     $new_current_lang = current_lang();
     $this->assertEquals('en', $current_lang);
     $this->assertEquals('bg', $new_current_lang);
     $lang_string_test = _e("Select country", true);
     $this->assertEquals('Избери държава', $lang_string_test);
 }
Пример #16
0
 public function show($id)
 {
     $country = $this->country->show($id, current_lang());
     $args = ['orderby' => 'order', 'order' => 'asc'];
     $items = $country->provinces()->with(['langs' => function ($q) {
         $q->where('code', current_lang());
         $q->select('id', 'code');
     }])->get();
     $data = ['title' => 'Danh sách tỉnh', 'country' => $country, 'countries' => $this->country->listAll(true, current_lang()), 'items' => $items];
     return view('backend.province.index', $data);
 }
Пример #17
0
 public function index(Request $request)
 {
     $orderby = $request->has('orderby') ? $request->get('orderby') : 'id';
     $order = $request->has('order') ? $request->get('order') : 'asc';
     $key = $request->has('key') ? $request->get('key') : null;
     $order_multilang = $request->has('multilang') ? $request->get('multilang') : false;
     $args = ['orderby' => $orderby, 'order' => $order, 'key' => $key, 'multilang' => $order_multilang, 'search_field' => 'name', 'multilang' => $order_multilang];
     $items = $this->cat->all('roomconv', current_lang(), $args);
     $data = ['title' => 'Tiện nghi phòng', 'items' => $items, 'parents' => [0 => 'Chọn mục cha'] + $this->cat->listType('roomconv', 0, true, default_lang())];
     return view('backend.room.convenient.index', $data);
 }
Пример #18
0
 public function index(Request $request)
 {
     $orderby = $request->has('orderby') ? $request->get('orderby') : 'id';
     $order = $request->has('order') ? $request->get('order') : 'asc';
     $key = $request->has('key') ? $request->get('key') : null;
     $order_multilang = $request->has('multilang') ? $request->get('multilang') : false;
     $args = ['orderby' => $orderby, 'order' => $order, 'key' => $key, 'multilang' => $order_multilang, 'search_field' => 'name', 'multilang' => $order_multilang];
     $items = $this->roomtype->all('roomtype', current_lang(), $args);
     $data = ['title' => 'Quản lý loại phòng', 'items' => $items];
     return view('backend.roomtype.index', $data);
 }
Пример #19
0
 public function index(Request $request)
 {
     authorize('list_services');
     $orderby = $request->has('orderby') ? $request->get('orderby') : 'id';
     $order = $request->has('order') ? $request->get('order') : 'asc';
     $key = $request->has('key') ? $request->get('key') : null;
     $order_multilang = $request->has('multilang') ? $request->get('multilang') : false;
     $args = ['orderby' => $orderby, 'order' => $order, 'key' => $key, 'multilang' => $order_multilang, 'search_field' => 'name'];
     $items = $this->services->all(current_lang(), $args);
     $data = ['title' => 'Quản lý Dịch vụ', 'items' => $items];
     return view('backend.services.index', $data);
 }
Пример #20
0
 public function show($id, $slug)
 {
     $item = $this->hotel->show($id);
     //return $item;
     $rooms = $item->rooms()->with(['langs' => function ($q) {
         $q->where('code', current_lang());
         $q->select('id');
     }])->orderBy('created_at', 'desc')->paginate(get_option('_paginate'));
     $convs = $this->tax->all('hotelconv', current_lang());
     $currconvs = $item->convenients()->lists('id')->toArray();
     $convs_tree = $this->tax->list_trees($convs, 0, $currconvs, 0);
     //dd($convs_tree);
     $data = ['hotel' => $item, 'rooms' => $rooms, 'convenients' => $convs_tree];
     return view('frontend.hotel', $data);
 }
Пример #21
0
 public function listAll($name = true, $lang = null)
 {
     $lang = $lang ? $lang : current_lang();
     $result = [];
     $item = $this->model->with(['langs' => function ($q) use($lang) {
         $q->where('code', $lang);
     }])->orderBy('id', 'asc')->get(['id']);
     if ($name) {
         foreach ($item as $country) {
             $result[$country->id] = $country->langs->first()->pivot->name;
         }
     } else {
         foreach ($item as $country) {
             $result[] = $country->id;
         }
     }
     return $result;
 }
Пример #22
0
 public function listType($type = 'cat', $except_id = null, $name = true, $lang = null)
 {
     $lang = $lang ? $lang : current_lang();
     $result = [];
     $item = $this->model->where('type', $type)->where('id', '!=', $except_id)->with(['langs' => function ($q) use($lang) {
         $q->where('code', $lang);
     }])->orderBy('id', 'asc')->get(['id']);
     if ($name) {
         foreach ($item as $province) {
             $result[$province->id] = $province->langs->first()->pivot->name;
         }
     } else {
         foreach ($item as $province) {
             $result[] = $province->id;
         }
     }
     return $result;
 }
Пример #23
0
/**
 * Shows a section of the help file.
 *
 * @internal its used on the help in the admin
 */
function show_help($section = 'main')
{
    $lang = current_lang();
    $lang = str_replace('..', '', $lang);
    if (trim($lang) == '') {
        $lang = 'en';
    }
    $lang_file = mw_includes_path() . 'help' . DIRECTORY_SEPARATOR . $lang . '.php';
    $lang_file_en = mw_includes_path() . 'help' . DIRECTORY_SEPARATOR . $lang . '.php';
    $lang_file = normalize_path($lang_file, false);
    if (is_file($lang_file)) {
        include $lang_file;
    } elseif (is_file($lang_file_en)) {
        return $lang_file_en;
    }
}
Пример #24
0
 public function getName()
 {
     $item = $this->langs()->where('code', current_lang())->first(['id']);
     return $item ? $item->pivot->name : null;
 }
Пример #25
0
assets/foundation/js/vendor/custom.modernizr.js"></script>
  
  <script src="<?php 
echo base_url();
?>
assets/js/jquery-1.10.2.min.js"></script>
  <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> 
  
  <script src="<?php 
echo base_url();
?>
assets/js/komira.js"></script>
  
  <script>
  	var lang = '<?php 
echo current_lang();
?>
';
  	var verification_interval = <?php 
echo ci_config('verification_interval');
?>
;
  </script>
 	
</head>
<body>

  <!-- body content here -->

	<div class="row">
	  <div class="large-6 large-centered columns"><h2 class="centered-text"><?php 
">
						<div class="btn-dropdown">
							<a href="#" role="button" class="btn btn-small toggle-dropdown" title="<?php 
echo current_lang('name');
?>
"><i class="flag flag-<?php 
echo current_lang('flag');
?>
"></i></a>
							<ul class="menu-right menu-<?php 
echo current_lang('direction');
?>
">
<?php 
foreach ($this->i18n->languages() as $key => $lang) {
    if (current_lang('folder') != $key) {
        ?>
								<li><a href="#" role="button" class="clang" data-lang="<?php 
        echo $lang['code'];
        ?>
"><i class="flag flag-<?php 
        echo $lang['flag'];
        ?>
"></i> <?php 
        echo $lang['name'];
        ?>
</a></li>
<?php 
    }
}
?>
Пример #27
0
 public function index(Request $request)
 {
     $args = ['orderby' => $request->has('orderby') ? $request->get('orderby') : 'order', 'order' => $request->has('order') ? $request->get('order') : 'asc', 'multilang' => $request->has('multilang') ? $request->get('multilang') : false];
     $data = ['title' => 'Quản lý Slide', 'items' => $this->slide->all(current_lang(), $args)];
     return view('backend.slide.index', $data);
 }
Пример #28
0
 public function post_lang($code = null)
 {
     return $this->langs()->where('code', $code == null ? current_lang() : $code)->first()->pivot;
 }
Пример #29
0
                        $div->span(trans('ravel::content.comment_days'));
                        $div->setRootAttr('ng-show', 'item.allow_comments');
                    });
                });
                $div->fieldset(function ($div) {
                    $div->legend(trans('ravel::content.security'));
                    $div->checkbox('locked_content')->ng_model('item.content_locked', 'ng-model')->ng_checked('item.content_locked', 'ng-checked');
                    $div->span(trans('ravel::content.enable'));
                    $div->div(function ($div) {
                        $div->password('content_password', trans('ravel::content.content_locked'))->ng_model('item.content_password');
                        $div->setRootAttr('ng-show', 'item.content_locked');
                    });
                });
                $div->br();
                $div->hr();
                $div->div(function ($div) {
                    $div->span(trans('ravel::content.content_language'));
                    $div->span(langflag(current_lang()));
                });
                $div->br();
                $div->br();
                $div->button(trans('ravel::content.save'))->class('button')->ng_click('submit()', 'ng-click');
                $div->button(trans('ravel::content.cancel'))->class('button')->ng_click('cancel()', 'ng-click');
                $div->button(trans('ravel::form.delete'))->class('button')->ng_click('delete()', 'ng-click');
                $div->setClass('column-panel');
            });
            $div->setClass('column span4');
        });
        $form->div()->class('clear');
    });
});
Пример #30
0
 public function find_lang($status_id, $lang_id = null, $columns = ['*'])
 {
     $lang_id = $lang_id ? $lang_id : current_lang();
     return $this->model->where('status_id', $status_id)->where('lang_id', $lang_id)->first($columns);
 }