本文整理汇总了PHP中set_crumbs函数的典型用法代码示例。如果您正苦于以下问题:PHP set_crumbs函数的具体用法?PHP set_crumbs怎么用?PHP set_crumbs使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_crumbs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
function edit()
{
$data = array();
$this->template->add_package(array('ckeditor', 'ck_jq_adapter'));
$data['Image'] = $Image = $this->load->model('gallery_images_model');
$image_id = $this->uri->segment(5);
$Image->get_by_id($image_id);
if (!$Image->exists()) {
return show_404();
}
$data['breadcrumb'] = set_crumbs(array('galleries' => 'Galleries', 'galleries/images/index/' . $Image->gallery_id => 'Images', current_url() => 'Image Edit'));
// Validate Form
$this->form_validation->set_rules('title', 'Title', "trim|required");
$this->form_validation->set_rules('alt', 'Alternative Text', "trim");
$this->form_validation->set_rules('description', 'Description', 'trim');
$this->form_validation->set_rules('filename', 'filename', 'trim|required');
$this->form_validation->set_rules('hide', 'Hide', 'trim|integer');
if ($this->form_validation->run() == TRUE) {
$Image->from_array($this->input->post());
$Image->description = $this->input->post('description') != '' ? $this->input->post('description') : NULL;
$Image->alt = $this->input->post('alt') != '' ? $this->input->post('alt') : NULL;
$Image->hide = $this->input->post('hide') ? 1 : 0;
$Image->save();
$this->session->set_flashdata('message', '<p class="success">Image saved successfully.</p>');
redirect(ADMIN_PATH . '/galleries/images/index/' . $Image->gallery_id);
}
$_SESSION['KCFINDER'] = array();
$_SESSION['KCFINDER']['disabled'] = false;
$_SESSION['isLoggedIn'] = true;
$this->template->view('admin/images/edit', $data);
}
示例2: edit
function edit()
{
// Init
$data = array();
$data['breadcrumb'] = set_crumbs(array('navigations/groups' => 'Navigations', current_url() => 'Navigation Edit'));
$data['Group'] = $Group = $this->load->model('navigations_model');
$data['edit_mode'] = $edit_mode = FALSE;
$group_id = $this->uri->segment(4);
if (!empty($group_id)) {
$data['edit_mode'] = $edit_mode = TRUE;
$Group->get_by_id($group_id);
if (!$Group->exists()) {
return show_404();
}
}
$this->form_validation->set_rules('title', 'Title', 'trim|required|max_length[255]');
// Form validation
if ($this->form_validation->run() == TRUE) {
$Group->from_array($this->input->post());
$Group->save();
$this->session->set_flashdata('message', '<p class="success">Navigation Saved.<p>');
if ($edit_mode) {
redirect(ADMIN_PATH . '/navigations');
} else {
redirect(ADMIN_PATH . '/navigations/items/tree/' . $Group->id);
}
}
$this->template->view('admin/navigations/edit', $data);
}
示例3: edit
function edit()
{
$data['breadcrumb'] = set_crumbs(array('galleries' => 'Galleries', current_url() => 'Gallery Edit'));
$data['Gallery'] = $Gallery = $this->load->model('galleries_model');
$data['edit_mode'] = $edit_mode = FALSE;
$gallery_id = $this->uri->segment(4);
$this->load->helper('file');
// Set Mode
if ($gallery_id) {
$data['edit_mode'] = $edit_mode = TRUE;
$Gallery->get_by_id($gallery_id);
if (!$Gallery->exists()) {
return show_404();
}
}
// Validate Form
$this->form_validation->set_rules('title', 'Title', "trim|required");
if ($this->form_validation->run() == TRUE) {
$Gallery->from_array($this->input->post());
$Gallery->save();
if ($edit_mode) {
$this->session->set_flashdata('message', '<p class="success">Gallery saved successfully.</p>');
redirect(ADMIN_PATH . '/galleries');
} else {
redirect(ADMIN_PATH . '/galleries/images/index/' . $Gallery->id);
}
}
$this->template->view('admin/galleries/edit', $data);
}
示例4: index
function index()
{
// Init
$data = array();
$this->load->library('pagination');
$per_page = 500;
$data['breadcrumb'] = set_crumbs(array('trivia/invitationlog/' => 'Invitations', current_url() => 'Logs'));
$invitationsModel = $this->load->model('trivia/invitation_log_model');
$sort = $this->input->get('sort') != "" ? $this->input->get('sort') : '';
$order = $this->input->get('order') != "" ? $this->input->get('order') : '';
$data['query_string'] = !empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '';
$limit = $this->uri->segment(5) ? $this->uri->segment(5) : 0;
// Create Pagination
$config['base_url'] = site_url(ADMIN_PATH . '/trivia/invitationlog/index/');
$config['total_rows'] = $invitationsModel->record_count();
$config['per_page'] = $per_page;
$config['uri_segment'] = '5';
$config['num_links'] = 5;
$config['suffix'] = $data['query_string'];
$this->pagination->initialize($config);
$filter = $this->input->get('filter') ? $this->input->get('filter') : '';
// sending params to view page
$data['no_pages'] = ceil($config['total_rows'] / $per_page);
$data['total'] = $config['total_rows'];
$data['limit'] = $limit;
$data['status'] = $invitationsModel->getInvitationStatus();
$data['per_page'] = $config['per_page'];
$invitations = $invitationsModel->get_all_invitations($sort, $order, $per_page, $limit, $filter);
$data['invitaitons'] = $invitations;
$this->template->view('admin/invitation_log', $data);
}
示例5: edit
function edit()
{
$catId = $this->uri->segment(5);
$breadCrumbLabel = $catId != "" ? 'Edit Category' : 'Add Category';
$fileName = "";
$data = array();
$data['breadcrumb'] = set_crumbs(array('redemption/categories' => 'Redemption', current_url() => $breadCrumbLabel));
$data['categories'] = $this->redemption_categories_model->get_category_options();
$data['category_model'] = $Categories = $this->redemption_categories_model;
$data['edit_mode'] = $edit_mode = FALSE;
if ($catId) {
$data['edit_mode'] = $edit_mode = TRUE;
$Categories->get_by_id($catId);
}
$this->form_validation->set_rules('name', 'Category Name', 'trim|required');
$this->form_validation->set_rules('slug', 'Slug', 'trim|required|' . ($edit_mode && $Categories->slug == $this->input->post('slug') ? '' : 'is_unique[' . self::RED_CATEGORY . '.slug]'));
$this->form_validation->set_rules('description', 'Description', 'trim|required');
$this->form_validation->set_rules('excerpt', 'Excerpt', 'trim|required');
if ($this->form_validation->run() == TRUE) {
try {
$fileName = $Categories->uploadImages($_FILES['image_categories']);
} catch (Exception $ex) {
$this->session->set_flashdata('message', '<p class="error">' . $ex->getMessage() . '</p>');
redirect(ADMIN_PATH . '/redemption/categories/edit/' . $catId);
}
$Categories->from_array($this->input->post());
if (isset($_FILES['image_categories']) && $_FILES['image_categories']['name']) {
$Categories->image_categories = $fileName;
}
$Categories->save();
$this->session->set_flashdata('message', '<p class="success">Category Saved Successfully.</p>');
redirect(ADMIN_PATH . '/redemption/categories');
}
$this->template->view('admin/categories/edit', $data);
}
示例6: index
public function index()
{
$data = array();
$this->load->library('pagination');
$per_page = 50;
$data['breadcrumb'] = set_crumbs(array('reports/quote/' => 'Reports', current_url() => 'Quote'));
$reportModel = $this->load->model('reports/report_model');
$sort = $this->input->get('sort') != "" ? $this->input->get('sort') : '';
$order = $this->input->get('order') != "" ? $this->input->get('order') : '';
$data['query_string'] = !empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '';
$limit = $this->uri->segment(5) ? $this->uri->segment(5) : 0;
$config['base_url'] = site_url(ADMIN_PATH . '/reports/quote/index/');
$trows = count($reportModel->getQuoteReportsCount());
$config['total_rows'] = $trows;
$config['per_page'] = $per_page;
$config['uri_segment'] = '5';
$config['num_links'] = 5;
$config['suffix'] = $data['query_string'];
$this->pagination->initialize($config);
$filter = $this->input->get('filter') ? $this->input->get('filter') : '';
$data['no_pages'] = ceil($config['total_rows'] / $per_page);
$data['total'] = $config['total_rows'];
$data['limit'] = $limit;
$data['per_page'] = $config['per_page'];
$reports = $reportModel->getQuoteReports($sort, $order, $per_page, $limit, $filter);
$data['reports'] = $reports;
// print_r($data);exit;
$this->template->view('admin/quote', $data);
}
示例7: edit
function edit()
{
$catId = $this->uri->segment(5);
$breadCrumbLabel = $catId != "" ? 'Edit Category' : 'Add Category';
// Init
$data = array();
$data['breadcrumb'] = set_crumbs(array('trivia/categories' => 'Trivia Categories', current_url() => $breadCrumbLabel));
$data['categories'] = $Categories = $this->load->model('trivia/trivia_categories_model');
$data['edit_mode'] = $edit_mode = FALSE;
// Edit Mode
if ($catId) {
$data['edit_mode'] = $edit_mode = TRUE;
$Categories->get_by_id($catId);
}
// Validate Form
$this->form_validation->set_rules('name', 'Category Name', 'trim|required');
// Process Form
if ($this->form_validation->run() == TRUE) {
$Categories->from_array($this->input->post());
$currentDate = date('Y-m-d H:i:s');
if (!$edit_mode) {
$Categories->created_by = $this->secure->get_user_session()->id;
$Categories->created_on = $currentDate;
}
$Categories->save();
$this->session->set_flashdata('message', '<p class="success">Category Saved Successfully.</p>');
redirect(ADMIN_PATH . '/trivia/categories');
}
// Get Groups From DB
$this->template->view('admin/categories/edit', $data);
}
示例8: index
function index()
{
// Init
$data = array();
$this->load->library('pagination');
$per_page = 50;
$data['breadcrumb'] = set_crumbs(array('reports/binder' => 'Reports', current_url() => 'Binder Reports'));
$binder = $this->load->model('quote/binder_request_model');
$sort = $this->input->get('sort') != "" ? $this->input->get('sort') : '';
$order = $this->input->get('order') != "" ? $this->input->get('order') : '';
$data['query_string'] = !empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '';
$limit = $this->uri->segment(5) ? $this->uri->segment(5) : 0;
// Create Pagination
$config['base_url'] = site_url(ADMIN_PATH . '/reports/binder/index/');
$trows = $binder->countBinderReport();
$config['total_rows'] = count($trows);
$config['per_page'] = $per_page;
$config['uri_segment'] = '5';
$config['num_links'] = 5;
$config['suffix'] = $data['query_string'];
$this->pagination->initialize($config);
// sending params to view page
$data['no_pages'] = ceil($config['total_rows'] / $per_page);
$data['total'] = $config['total_rows'];
$data['limit'] = $limit;
$data['per_page'] = $config['per_page'];
$report = $binder->getBinderReport($sort, $order, $per_page, $limit);
// print_r($report); exit;
$data['report'] = $report;
$this->template->view('admin/binder', $data);
}
示例9: index
function index()
{
$data = array();
$data['breadcrumb'] = set_crumbs(array('trivia/reward/' => 'Rewards', current_url() => 'Reward'));
$Rewards = $this->load->model('points/user_log_points_model');
$this->load->library('pagination');
$per_page = 50;
$data['query_string'] = !empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '';
$limit = $this->uri->segment(5) ? $this->uri->segment(5) : 0;
$sort = $this->input->get('sort') != "" ? $this->input->get('sort') : '';
$order = $this->input->get('order') != "" ? $this->input->get('order') : '';
$data['persons'] = $Rewards->get_all_persons($sort, $order, $per_page, $limit);
// Create Pagination
$config['base_url'] = site_url(ADMIN_PATH . '/trivia/reward/index/');
$config['total_rows'] = $Rewards->record_count();
$config['per_page'] = $per_page;
$config['uri_segment'] = '5';
$config['num_links'] = 5;
$config['suffix'] = $data['query_string'];
$this->pagination->initialize($config);
$data['no_pages'] = ceil($config['total_rows'] / $per_page);
$data['total'] = $config['total_rows'];
$data['limit'] = $limit;
$data['per_page'] = $config['per_page'];
$this->template->view('admin/rewards', $data);
}
示例10: index
function index()
{
// Init
$data = array();
$data['breadcrumb'] = set_crumbs(array(current_url() => 'General Settings'));
$this->load->model('settings/settings_model');
$this->load->model('users/groups_model');
$this->load->model('content/entries_model');
// Get Themes
$data['themes'] = $this->template->get_themes();
$data['layouts'] = $this->template->get_theme_layouts();
// Get Groups
$Groups = new Groups_model();
$data['Groups'] = $Groups->where('type !=', 'super_admin')->order_by('name')->get();
// Get All Entries
$Entries = new Entries_model();
$data['Entries'] = $Entries->order_by('title')->get();
// Build object with current settings
$Settings_table = $this->settings_model->get();
$data['Settings'] = new stdClass();
foreach ($Settings_table as $Setting) {
$data['Settings']->{$Setting->slug} = new stdClass();
$data['Settings']->{$Setting->slug}->value = $Setting->value;
$data['Settings']->{$Setting->slug}->module = $Setting->module;
}
// Form Validation Rules
$this->form_validation->set_rules('site_name', 'Site Name', 'trim|required');
$this->form_validation->set_rules('notification_email', 'Notification Email', 'trim|required|valid_email');
$this->form_validation->set_rules('content[site_homepage]', 'Site Homepage', 'trim|required');
$this->form_validation->set_rules('content[custom_404]', 'Custom 404', 'trim|required');
$this->form_validation->set_rules('enable_admin_toolbar', 'Admin Toolbar', 'trim|required');
$this->form_validation->set_rules('suspend', 'Suspend Site', 'trim|required');
$this->form_validation->set_rules('users[default_group]', 'Default User Group', 'trim|required');
$this->form_validation->set_rules('users[enable_registration]', 'User Registration', 'trim|required');
$this->form_validation->set_rules('users[email_activation]', 'Require Email Activation', 'trim|required');
// Form Processing
if ($this->form_validation->run() == TRUE) {
foreach ($_POST as $slug => $value) {
if (is_array($value)) {
// Value is an array so save it as a module setting
foreach ($value as $module_slug => $module_value) {
$Settings_m = new Settings_model();
$Settings_m->where('slug', $module_slug)->where('module', $slug)->update('value', $module_value);
}
} else {
$Settings_m = new Settings_model();
$Settings_m->where('slug', $slug)->where('module IS NULL')->update('value', $value);
}
unset($Settings_m);
}
$this->load->library('cache');
$this->cache->delete_all('settings');
$this->session->set_flashdata('message', '<p class="success">Settings Saved.</p>');
redirect(uri_string());
}
$this->template->view('admin/general_settings', $data);
}
示例11: edit
function edit()
{
// Init
$data = array();
$data['edit_mode'] = FALSE;
$this->template->add_package(array('codemirror'));
$data['breadcrumb'] = set_crumbs(array('content/snippets' => 'Snippets', current_url() => 'Snippet Edit'));
$data['revision_id'] = $revision_id = $this->uri->segment(6);
$this->load->model('snippets_model');
$data['Snippet'] = $Snippet = new Snippets_model();
$snippet_id = $this->uri->segment(5);
// Edit mode
if ($snippet_id) {
$data['edit_mode'] = TRUE;
$Snippet->get_by_id($snippet_id);
// Check if snippet exists
if (!$Snippet->exists()) {
return show_404();
}
// Load a revision if a revision id was provided in the URL
if (!empty($revision_id)) {
$this->load->model('revisions_model');
$Revision = new Revisions_model();
$Revision->get_by_id($revision_id);
if ($Revision->exists()) {
$revision_data = @unserialize($Revision->revision_data);
$Snippet->from_array($revision_data);
} else {
return show_404();
}
}
}
$this->form_validation->set_rules('title', 'Title', 'trim|required');
$this->form_validation->set_rules('short_name', 'Short Name', 'trim|required|alpha_dash|max_length[50]|is_unique[snippets.short_name.id.' . $snippet_id . ']');
$this->form_validation->set_rules('snippet', 'Snippet', '');
// Form validation
if ($this->form_validation->run() == TRUE) {
$Snippet->from_array($this->input->post());
if ($data['edit_mode']) {
$Snippet->id = $snippet_id;
}
$Snippet->save();
$Snippet->add_revision();
// Clear cache
$this->load->library('cache');
$this->cache->delete_all('snippets');
$this->session->set_flashdata('message', '<p class="success">Snippet Saved.</p>');
if ($this->input->post('save_exit')) {
redirect(ADMIN_PATH . '/content/snippets/');
} else {
redirect(ADMIN_PATH . '/content/snippets/edit/' . $Snippet->id);
}
}
$this->template->view('admin/snippets/edit', $data);
}
示例12: index
function index()
{
$data = array();
$data['breadcrumb'] = set_crumbs(array(current_url() => 'Server Info'));
$this->template->add_stylesheet('/application/modules/settings/assets/css/server_info.css');
ob_start();
phpinfo();
$pinfo = ob_get_contents();
ob_end_clean();
$data['pinfo'] = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $pinfo);
$this->template->view('admin/server_info', $data);
}
示例13: edit
function edit()
{
// Init
$data = array();
$data['breadcrumb'] = set_crumbs(array('users/groups' => 'User Groups', current_url() => 'Group Edit'));
$data['Group'] = $Group = $this->load->model('groups_model');
$data['permissions'] = array();
$group_id = $this->uri->segment(5);
$data['edit_mode'] = $edit_mode = FALSE;
$data['permission_options'] = unserialize(ADMIN_ACCESS_OPTIONS);
// Edit Mode
if ($group_id) {
$data['edit_mode'] = $edit_mode = TRUE;
$Group->get_by_id($group_id);
// Stop non-super admins from editing super admins
if ($this->secure->get_group_session()->type != SUPER_ADMIN && $Group->type == SUPER_ADMIN) {
show_404();
}
if ($Group->exists()) {
$data['permissions'] = unserialize($Group->permissions);
} else {
show_404();
}
}
// Validate Form
$this->form_validation->set_rules('name', 'Group Name', "trim|required|callback_name_check[{$group_id}]");
$this->form_validation->set_rules('permissions[access][]', 'Access Permissions', "trim");
if ($edit_mode && $Group->modifiable_permissions) {
$this->form_validation->set_rules('type', 'Group Type', "trim|required");
} else {
$this->form_validation->set_rules('type', 'Group Type', "trim");
}
if ($this->form_validation->run() == TRUE) {
$Group = new Groups_model();
// Load group to update if in edit mode
if (!empty($group_id)) {
$Group->get_by_id($group_id);
}
$Group->from_array($this->input->post());
// If permissions posted serialize for db
if ($this->input->post('permissions') && $this->input->post('type') == 'administrator') {
$Group->permissions = serialize($this->input->post('permissions'));
} elseif ($edit_mode && $data['Group']->modifiable_permissions || !$edit_mode || $edit_mode && $Group->type == ADMINISTRATOR && $this->Group_session->type == SUPER_ADMIN) {
$Group->permissions = NULL;
}
// Save Changes
$Group->save();
$this->session->set_flashdata('message', '<p class="success">User Group Saved.</p>');
redirect(ADMIN_PATH . '/users/groups');
}
$this->template->view('admin/groups/edit', $data);
}
示例14: index
function index()
{
$data = array();
$data['breadcrumb'] = set_crumbs(array(current_url() => 'Clear Cache'));
$this->form_validation->set_rules('cache[]', 'Cache', 'required');
if ($this->form_validation->run() == TRUE) {
$this->load->library('cache');
foreach ($this->input->post('cache') as $cache => $value) {
// Clear cache
switch ($cache) {
case "entries":
$this->cache->delete_all('entries');
break;
case "content_types":
$this->cache->delete_all('content_types');
break;
case "snippets":
$this->cache->delete_all('snippets');
break;
case "images":
// Cached images are located outside the cache directory
// due to strict security restrictions on the cache folder
$this->load->helper('file');
if (file_exists(CMS_ROOT . IMAGE_CACHE)) {
foreach (glob(CMS_ROOT . IMAGE_CACHE . '/*') as $file) {
@unlink($file);
}
}
break;
case "navigations":
$this->cache->delete_all('navigations');
break;
case "categories":
$this->cache->delete_all('categories');
break;
case "settings":
$this->cache->delete_all('settings');
break;
case "datamapper":
$this->cache->delete_all('datamapper');
break;
}
}
// Set a success message
$this->session->set_flashdata('message', '<p class="success">Cache succcessfully cleared.</p>');
redirect(current_url());
}
$this->template->view('admin/clear_cache', $data);
}
示例15: index
public function index()
{
$data = array();
$this->load->library('pagination');
$per_page = 50;
$filter = array();
if ($this->input->post()) {
$filter = $this->input->post();
}
if ($this->input->get('reset')) {
$this->session->unset_userdata(self::RED_ORDERS);
} else {
if (!empty($filter)) {
$this->session->set_userdata(array(self::RED_ORDERS => $filter));
} else {
$filter = $this->session->userdata(self::RED_ORDERS);
}
}
$data['breadcrumb'] = set_crumbs(array('/redemption/order/' => 'Requests', current_url() => 'Orders'));
$requestsModel = $this->load->model('redemption/order_model');
$sort = $this->input->get('sort') != "" ? $this->input->get('sort') : '';
$order = $this->input->get('order') != "" ? $this->input->get('order') : '';
$data['query_string'] = !empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '';
$limit = $this->uri->segment(5) ? $this->uri->segment(5) : 0;
$count = count($requestsModel->record_count($sort, $order, $per_page, $limit, $filter));
$config['base_url'] = site_url(ADMIN_PATH . '/redemption/order/index/');
$config['total_rows'] = $count;
$config['per_page'] = $per_page;
$config['uri_segment'] = '5';
$config['num_links'] = 5;
$config['suffix'] = $data['query_string'];
$this->pagination->initialize($config);
$data['no_pages'] = ceil($config['total_rows'] / $per_page);
$data['total'] = $config['total_rows'];
$data['limit'] = $limit;
$data['per_page'] = $config['per_page'];
$data['params'] = $filter;
$requests = $requestsModel->getOrderData($sort, $order, $per_page, $limit, $filter);
$data['requestsdata'] = $requests;
// print_r($data);exit;
$this->template->view('admin/order', $data);
}