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


PHP LL函数代码示例

本文整理汇总了PHP中LL函数的典型用法代码示例。如果您正苦于以下问题:PHP LL函数的具体用法?PHP LL怎么用?PHP LL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: select_levels

 public static function select_levels()
 {
     $role = array(0 => LL('cms::form.select', CMSLANG));
     $max = ROLE;
     for ($i = 2; $i < $max; $i++) {
         $role[$i] = $i;
     }
     return $role;
 }
开发者ID:SerdarSanri,项目名称:PongoCMS-Laravel-cms-bundle,代码行数:9,代码来源:cmsrole.php

示例2: get_index

 public function get_index($lang_to = 'en')
 {
     //LOAD JS LIBS
     Asset::container('footer')->add('form', 'bundles/cms/js/jquery.form.js', 'jquery');
     Asset::container('footer')->add('translations', 'bundles/cms/js/sections/translations_list.js', 'cms');
     $this->layout->header_data = array('title' => LL('cms::title.translations', CMSLANG));
     $this->layout->top_data = array('search' => false);
     $langs = CmsPage::select_lang_translation();
     $my_lang = LANG;
     array_shift($langs);
     //GET DATA
     $data = CmsTranslation::where('lang_from', '=', $my_lang)->where('lang_to', '=', $lang_to)->order_by('word', 'asc')->get();
     $this->layout->content = View::make('cms::interface.pages.translation_list')->with('langs', $langs)->with('lang_from', $my_lang)->with('lang_to', $lang_to)->with('data', $data);
 }
开发者ID:SerdarSanri,项目名称:PongoCMS-Laravel-cms-bundle,代码行数:14,代码来源:translation.php

示例3: select_zone

 public static function select_zone($page_id = '')
 {
     $zones = array(0 => LL('cms::form.select', CMSLANG));
     if (!empty($page_id)) {
         $rs = CmsPage::find($page_id);
         $layout = $rs->layout;
         if (!empty($layout)) {
             $zone_arr = Config::get('cms::theme.layout_' . $layout);
             foreach ($zone_arr as $key => $value) {
                 $zones[$key] = $value;
             }
         }
     }
     return $zones;
 }
开发者ID:BGCX262,项目名称:zweer-laravel-svn-to-git,代码行数:15,代码来源:cmselement.php

示例4: post_index

 public function post_index()
 {
     //POST LOGIN
     $credentials = array('cms' => true, 'username' => Input::get('username'), 'password' => Input::get('password'), 'remember' => false);
     //CHECK CREDENTIALS
     if (Auth::attempt($credentials)) {
         //SUCCESS NOTIFICATION
         return Redirect::to_action('cms::dashboard');
     } else {
         //ERROR NOTIFICATION
         Notification::error(LL('cms::alert.login_error', CMSLANG));
         //BACK TO LOGIN
         return Redirect::to_action('cms::login')->with_input('only', array('username'));
     }
 }
开发者ID:SerdarSanri,项目名称:PongoCMS-Laravel-cms-bundle,代码行数:15,代码来源:login.php

示例5: post_delete_translation

 public function post_delete_translation()
 {
     $auth = Auth::check();
     if ($auth and is_numeric(AUTHORID)) {
         $id = Input::get('id');
         $trans = CmsTranslation::find($id);
         $trans->delete();
         $tid = $id;
         $response = 'success';
         $msg = LL('cms::ajax_resp.translation_delete_success', CMSLANG)->get();
     } else {
         $tid = null;
         $response = 'error';
         $msg = LL('cms::ajax_resp.translation_delete_error', CMSLANG)->get();
     }
     $data = array('auth' => $auth, 'id' => $tid, 'response' => $response, 'message' => $msg);
     return json_encode($data);
 }
开发者ID:SerdarSanri,项目名称:PongoCMS-Laravel-cms-bundle,代码行数:18,代码来源:ajax_translation.php

示例6: post_delete

 public function post_delete()
 {
     if (Input::has('user_id')) {
         $uid = Input::get('user_id');
         $user = CmsUser::find($uid);
         //CHECK IF USER EXISTS
         if (empty($user)) {
             Notification::error(LL('cms::alert.delete_user_error', CMSLANG), 2500);
             return Redirect::to_action('cms::user');
         } else {
             $user->delete();
             Notification::success(LL('cms::alert.delete_user_success', CMSLANG, array('user' => $user->username)), 1500);
             return Redirect::to_action('cms::user');
         }
     } else {
         Notification::error(LL('cms::alert.delete_user_error', CMSLANG), 1500);
         return Redirect::to_action('cms::user');
     }
 }
开发者ID:BGCX262,项目名称:zweer-laravel-svn-to-git,代码行数:19,代码来源:user.php

示例7: post_delete

 public function post_delete()
 {
     if (Input::has('role_id')) {
         $rid = Input::get('role_id');
         $page = CmsPage::where_role_id($rid)->first();
         //CHECK IF ROLE STILL IN USE
         if (!empty($page)) {
             Notification::error(LL('cms::alert.delete_role_stillinuse_error', CMSLANG, array('page' => $page->name)), 2500);
             return Redirect::to_action('cms::role');
         } else {
             $role = CmsRole::find($rid);
             $role->delete();
             Notification::success(LL('cms::alert.delete_role_success', CMSLANG, array('role' => $role->name)), 1500);
             return Redirect::to_action('cms::role');
         }
     } else {
         Notification::error(LL('cms::alert.delete_role_error', CMSLANG), 1500);
         return Redirect::to_action('cms::page');
     }
 }
开发者ID:SerdarSanri,项目名称:PongoCMS-Laravel-cms-bundle,代码行数:20,代码来源:role.php

示例8: post_delete

 public function post_delete()
 {
     if (Input::has('gallery_id')) {
         $gid = Input::get('gallery_id');
         $gallery = CmsGallery::find($gid);
         //CHECK IF GALLERY EXISTS
         if (!empty($gallery)) {
             //DELETE FROM DB
             $gallery->files()->delete();
             $gallery->delete();
             Notification::success(LL('cms::alert.delete_gallery_success', CMSLANG, array('gallery' => $gallery->name)), 1500);
             return Redirect::to_action('cms::gallery');
         } else {
             Notification::error(LL('cms::alert.delete_gallery_error', CMSLANG), 2500);
             return Redirect::to_action('cms::gallery');
         }
     } else {
         Notification::error(LL('cms::alert.delete_gallery_error', CMSLANG), 1500);
         return Redirect::to_action('cms::gallery');
     }
 }
开发者ID:BGCX262,项目名称:zweer-laravel-svn-to-git,代码行数:21,代码来源:gallery.php

示例9: post_delete

 public function post_delete()
 {
     if (Input::has('download_id')) {
         $did = Input::get('download_id');
         $download = CmsDownload::find($did);
         //CHECK IF DOWNLOAD EXISTS
         if (!empty($download)) {
             //DELETE FROM DB
             $download->files()->delete();
             $download->delete();
             Notification::success(LL('cms::alert.delete_download_success', CMSLANG, array('download' => $download->name)), 1500);
             return Redirect::to_action('cms::download');
         } else {
             Notification::error(LL('cms::alert.delete_download_error', CMSLANG), 2500);
             return Redirect::to_action('cms::download');
         }
     } else {
         Notification::error(LL('cms::alert.delete_download_error', CMSLANG), 1500);
         return Redirect::to_action('cms::download');
     }
 }
开发者ID:SerdarSanri,项目名称:PongoCMS-Laravel-cms-bundle,代码行数:21,代码来源:download.php

示例10: post_delete

 public function post_delete()
 {
     if (Input::has('tag_id')) {
         $tid = Input::get('tag_id');
         $tag = CmsTag::find($tid);
         //CHECK IF TAG EXISTS
         if (!empty($tag)) {
             $lang = $tag->lang;
             //DELETE FROM DB
             $tag->blogs()->delete();
             $tag->delete();
             Notification::success(LL('cms::alert.delete_tag_success', CMSLANG, array('tag' => $tag->name)), 1500);
             return Redirect::to_action('cms::tag', array($lang));
         } else {
             Notification::error(LL('cms::alert.delete_tag_error', CMSLANG), 2500);
             return Redirect::to_action('cms::tag', array($lang));
         }
     } else {
         Notification::error(LL('cms::alert.delete_gallery_error', CMSLANG), 1500);
         return Redirect::to_action('cms::tag', array($lang));
     }
 }
开发者ID:SerdarSanri,项目名称:PongoCMS-Laravel-cms-bundle,代码行数:22,代码来源:tag.php

示例11: post_save_role

 public function post_save_role()
 {
     $auth = Auth::check();
     if ($auth) {
         $input = Input::get();
         //GRAB DATA
         $role = new CmsRole();
         if (!empty($input['role_id'])) {
             $role = CmsRole::find($input['role_id']);
         }
         //VALIDATION CHECK
         $rules = array('role_name' => 'required|between:2,20|unique:roles,name,' . $input['role_id'], 'role_level' => 'not_in:0');
         $messages = array('required' => LL('cms::validation.required', CMSLANG)->get(), 'between' => LL('cms::validation.between.string', CMSLANG)->get(), 'unique' => LL('cms::validation.unique', CMSLANG)->get(), 'not_in' => LL('cms::validation.not_in', CMSLANG)->get());
         $validation = Validator::make($input, $rules, $messages);
         if ($validation->fails()) {
             return json_encode($validation->errors);
         }
         //VALIDATION OK
         $role->name = $input['role_name'];
         $role->level = $input['role_level'];
         $role->save();
         $rid = $role->id;
         //UPDATE ROLE LEVEL IN PAGE
         CmsPage::update_role_level($rid, $input['role_level']);
         $response = 'success';
         $msg = LL('cms::ajax_resp.role_save_success', CMSLANG)->get();
         $backurl = $input['back_url'];
     } else {
         $rid = null;
         $response = 'error';
         $msg = LL('cms::ajax_resp.role_save_error', CMSLANG)->get();
         $backurl = '#';
     }
     $data = array('auth' => $auth, 'cls' => 'role_id', 'id' => $rid, 'response' => $response, 'message' => $msg, 'backurl' => $backurl);
     return json_encode($data);
 }
开发者ID:BGCX262,项目名称:zweer-laravel-svn-to-git,代码行数:36,代码来源:ajax_role.php

示例12: post_save_tags

 public function post_save_tags()
 {
     $auth = Auth::check();
     if ($auth and is_numeric(AUTHORID)) {
         $input = Input::get();
         //GRAB DATA
         $blog = new CmsBlog();
         if (!empty($input['blog_id'])) {
             $blog = CmsBlog::find($input['blog_id']);
             //CHECK OWNERSHIP
             if (CmsRole::role_fail($input['page_id'])) {
                 $msg = array('noaccess' => LL('cms::ajax_resp.ownership_error', CMSLANG)->get());
                 return json_encode($msg);
             }
         }
         $bid = Input::get('blog_id');
         $pid = Input::get('page_id');
         if (Input::get('as_values_tags_id') !== '') {
             $tags = substr(Input::get('as_values_tags_id'), 0, -1);
             if (substr($tags, 0, 1) == ',') {
                 $tags = substr($tags, 1);
             }
             $rels = explode(',', $tags);
             if (is_array($rels)) {
                 $blog->tags()->sync($rels);
             }
             $response = 'success';
             $msg = LL('cms::ajax_resp.blog_tags_success', CMSLANG)->get();
             $backurl = $input['back_url'];
         } else {
             $response = 'success';
             $msg = LL('cms::ajax_resp.blog_tags_success', CMSLANG)->get();
             $backurl = $input['back_url'];
         }
     } else {
         $bid = null;
         $response = 'error';
         $msg = LL('cms::ajax_resp.blog_tags_error', CMSLANG)->get();
         $backurl = '#';
     }
     $data = array('auth' => $auth, 'cls' => 'blog_id', 'id' => $bid, 'pageid' => $pid, 'response' => $response, 'message' => $msg, 'backurl' => $backurl);
     return json_encode($data);
 }
开发者ID:SerdarSanri,项目名称:PongoCMS-Laravel-cms-bundle,代码行数:43,代码来源:ajax_blog.php

示例13: post_save_download

 public function post_save_download()
 {
     $auth = Auth::check();
     if ($auth) {
         $input = Input::get();
         //GRAB DATA
         $download = new CmsDownload();
         if (!empty($input['download_id'])) {
             $download = CmsDownload::find($input['download_id']);
         }
         //VALIDATION CHECK
         $rules = array('download_name' => 'required|alpha_dash|between:2,20|unique:downloads,name,' . $input['download_id']);
         $messages = array('required' => LL('cms::validation.required', CMSLANG)->get(), 'between' => LL('cms::validation.between.string', CMSLANG)->get(), 'unique' => LL('cms::validation.unique', CMSLANG)->get(), 'alpha_dash' => LL('cms::validation.alpha_dash', CMSLANG)->get());
         $validation = Validator::make($input, $rules, $messages);
         if ($validation->fails()) {
             return json_encode($validation->errors);
         }
         $download->name = strtolower($input['download_name']);
         $download->save();
         //DELETE CACHE
         if (CACHE) {
             Cache::forget('file_list_' . strtolower($input['download_name']));
         }
         $did = $download->id;
         if (Input::has('file_id')) {
             $files = Input::get('file_id');
             if (is_array($files)) {
                 // Empty template
                 $template = '';
                 foreach ($files as $fid) {
                     $check = DB::table('files_downloads')->where_cmsfile_id($fid)->where_cmsdownload_id($did)->first();
                     if (empty($check)) {
                         $download->files()->attach($fid, array('order_id' => 1000000));
                     }
                     $img = CmsFile::find($fid);
                     // Template returned
                     $template .= '<li id="' . $did . '_' . $fid . '" class="span1">';
                     $template .= '<a class="thumbnail" rel="tooltip" data-original-title="' . $img->name . '" href="' . BASE . $img->path . '">';
                     $template .= '<img src="' . BASE . $img->thumb . '" />';
                     $template .= '</a>';
                     $template .= '</li>';
                 }
                 //DELETE NOT IN
                 DB::table('files_downloads')->where_cmsdownload_id($did)->where_not_in('cmsfile_id', $files)->delete();
             }
             $response = 'success';
             $msg = LL('cms::ajax_resp.download_save_success', CMSLANG)->get();
             $backurl = $input['back_url'];
             // Inject container
             $inject = 'ul.sortable';
             $detach = true;
         } else {
             //DELETE ALL DOWNLOAD_ID
             DB::table('files_downloads')->where_cmsdownload_id($did)->delete();
             $response = 'success';
             $msg = LL('cms::ajax_resp.download_save_success', CMSLANG)->get();
             $backurl = $input['back_url'];
             $template = '';
             $inject = '';
             $detach = true;
         }
     } else {
         $response = 'error';
         $msg = LL('cms::ajax_resp.download_save_error', CMSLANG)->get();
         $backurl = '#';
         $template = '';
         $inject = '';
         $detach = true;
     }
     $data = array('auth' => $auth, 'cls' => 'download_id', 'id' => $did, 'response' => $response, 'message' => $msg, 'backurl' => $backurl, 'detach' => $detach, 'inject' => $inject, 'template' => $template);
     return json_encode($data);
 }
开发者ID:BGCX262,项目名称:zweer-laravel-svn-to-git,代码行数:72,代码来源:ajax_download.php

示例14: post_save_menu

 public function post_save_menu()
 {
     $auth = Auth::check();
     if ($auth) {
         $input = Input::get();
         //GRAB DATA
         $menu = new CmsMenu();
         if (!empty($input['menu_id'])) {
             $menu = CmsMenu::find($input['menu_id']);
         }
         //VALIDATION CHECK
         $rules = array('menu_name' => 'required|alpha_dash|between:2,20|unique_lang:' . $input['menu_id'] . ',' . $input['menu_lang'] . ',menus,name');
         $messages = array('required' => LL('cms::validation.required', CMSLANG)->get(), 'between' => LL('cms::validation.between.string', CMSLANG)->get(), 'unique_lang' => LL('cms::validation.unique', CMSLANG)->get(), 'alpha_dash' => LL('cms::validation.alpha_dash', CMSLANG)->get());
         $validation = Validator::make($input, $rules, $messages);
         if ($validation->fails()) {
             return json_encode($validation->errors);
         }
         $menu->name = strtolower($input['menu_name']);
         $menu->lang = strtolower($input['menu_lang']);
         $menu->parent_start = $input['parent_start'];
         $menu->is_nested = Input::has('is_nested') ? 1 : 0;
         //DELETE CACHE
         if (CACHE) {
             Cache::forget('menu_' . strtolower($input['menu_name']) . '_' . LANG);
         }
         if (CACHE) {
             Cache::forget('menu_pages_' . strtolower($input['menu_name']) . '_' . LANG);
         }
         $menu->save();
         $mid = $menu->id;
         // Empty template
         $template = '';
         if (Input::get('page_id') !== '') {
             $pages = Input::get('page_id');
             if (is_array($pages)) {
                 foreach ($pages as $pid) {
                     $check = DB::table('menus_pages')->where_cmspage_id($pid)->where_cmsmenu_id($mid)->first();
                     if (empty($check)) {
                         $menu->pages()->attach($pid, array('order_id' => Config::get('cms::settings.order')));
                     }
                     // Template returned
                     $template .= '<li id="' . $mid . '_' . $pid . '">';
                     $template .= '<a class="btn" href="#">';
                     $template .= '<i class="icon-resize-vertical"></i>';
                     $template .= CmsPage::find($pid)->name;
                     $template .= '</a>';
                     $template .= '</li>';
                 }
                 //DELETE NOT IN
                 DB::table('menus_pages')->where_cmsmenu_id($mid)->where_not_in('cmspage_id', $pages)->delete();
             }
             $response = 'success';
             $msg = LL('cms::ajax_resp.menu_save_success', CMSLANG)->get();
             $backurl = $input['back_url'];
             // Inject container
             $inject = 'ul.sortable';
             $detach = true;
         } else {
             //DELETE ALL MENU_ID
             DB::table('menus_pages')->where_cmsmenu_id($mid)->delete();
             $response = 'success';
             $msg = LL('cms::ajax_resp.menu_save_success', CMSLANG)->get();
             $backurl = $input['back_url'];
             $template = '';
             $inject = '';
             $detach = true;
         }
     } else {
         $response = 'error';
         $msg = LL('cms::ajax_resp.menu_save_error', CMSLANG)->get();
         $backurl = '#';
         $template = '';
         $inject = '';
         $detach = true;
     }
     $data = array('auth' => $auth, 'cls' => 'menu_id', 'id' => $mid, 'response' => $response, 'message' => $msg, 'backurl' => $backurl, 'detach' => $detach, 'inject' => $inject, 'template' => $template);
     return json_encode($data);
 }
开发者ID:BGCX262,项目名称:zweer-laravel-svn-to-git,代码行数:78,代码来源:ajax_menu.php

示例15: post_save_filename

 public function post_save_filename()
 {
     $auth = Auth::check();
     if ($auth) {
         $input = Input::get();
         //GRAB DATA
         if (!empty($input['file_id'])) {
             //GRAB DATA
             $file = CmsFile::find($input['file_id']);
             $fid = $file->id;
             $path = MEDIA_PATH($file->path);
             $name = $file->name;
             $ext = '.' . $file->ext;
             $filename = str_replace($ext, '', $name);
             $newname = $input['file_name'];
             //VALIDATION CHECK
             $rules = array('file_name' => 'required|alpha_dash|unique_filename:' . $file->ext . ',name');
             $messages = array('required' => LL('cms::validation.required', CMSLANG)->get(), 'unique_filename' => LL('cms::validation.unique_filename', CMSLANG)->get(), 'alpha_dash' => LL('cms::validation.alpha_dash', CMSLANG)->get());
             $validation = Validator::make($input, $rules, $messages);
             if ($validation->fails()) {
                 return json_encode($validation->errors);
             }
             //VALIDATION OK
             //RENAME DB
             //RENAME NAME
             $file->name = str_replace($filename, $newname, $name);
             //RENAME PATH
             $file->path = str_replace($filename, $newname, $file->path);
             //RENAME THUMB
             $file->thumb = str_replace($filename, $newname, $file->thumb);
             $file->save();
             //RENAME DISK
             //RENAME FILE
             if (file_exists($path)) {
                 rename($path, str_replace($filename, $newname, $path));
             }
             //LOOP ALL THUMBS AND RENAME
             foreach (Config::get('cms::theme.thumb') as $option) {
                 $thumb = MEDIA_NAME($path, $option['suffix']);
                 if (file_exists($thumb)) {
                     rename($thumb, str_replace($filename, $newname, $thumb));
                 }
             }
             $response = 'success';
             $msg = LL('cms::ajax_resp.filename_filename_success', CMSLANG)->get();
             $backurl = $input['back_url'];
         } else {
             $fid = null;
             $response = 'error';
             $msg = LL('cms::ajax_resp.filename_filename_error', CMSLANG)->get();
             $backurl = '#';
         }
     } else {
         $fid = null;
         $response = 'error';
         $msg = LL('cms::ajax_resp.filename_filename_error', CMSLANG)->get();
         $backurl = '#';
     }
     $data = array('auth' => $auth, 'cls' => 'file_id', 'id' => $fid, 'response' => $response, 'message' => $msg, 'backurl' => $backurl);
     return json_encode($data);
 }
开发者ID:BGCX262,项目名称:zweer-laravel-svn-to-git,代码行数:61,代码来源:ajax_file.php


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