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


PHP pjax函数代码示例

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


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

示例1: recent_news_configure

 public function recent_news_configure($action = 'show_settings', $widget_data = array())
 {
     if ($this->dx_auth->is_admin() == FALSE) {
         exit;
     }
     switch ($action) {
         case 'show_settings':
             $this->load->library('lib_category');
             $cats = $this->lib_category->build();
             //$this->display_tpl('recent_news_form', array('widget' => $widget_data, 'cats' => $cats));
             $this->render('recent_news_form', array('widget' => $widget_data, 'cats' => $cats));
             break;
         case 'update_settings':
             $this->form_validation->set_rules('news_count', lang("Amount of news", "core"), 'trim|required|is_natural_no_zero|min_length[1]');
             $this->form_validation->set_rules('max_symdols', lang("Maximum number of characters", "core"), 'trim|required|is_natural|min_length[1]');
             if ($this->form_validation->run($this) == FALSE) {
                 showMessage(validation_errors());
             } else {
                 $data = array('news_count' => $_POST['news_count'], 'max_symdols' => $_POST['max_symdols'], 'categories' => $_POST['categories'], 'display' => $_POST['display']);
                 $this->load->module('admin/widgets_manager')->update_config($widget_data['id'], $data);
                 showMessage(lang("Settings have been saved", 'core'));
                 if ($_POST['action'] == 'tomain') {
                     pjax('/admin/widgets_manager/index');
                 }
             }
             break;
         case 'install_defaults':
             $this->load->module('admin/widgets_manager')->update_config($widget_data['id'], $this->defaults);
             break;
     }
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:31,代码来源:core_widgets.php

示例2: show_form_configure

 /**
  * Configure widget settings
  * @param string $action
  * @param array $widget_data
  */
 public function show_form_configure($action = 'show_settings', array $widget_data = [])
 {
     if ($this->dx_auth->is_admin() == FALSE) {
         exit;
     }
     switch ($action) {
         case 'show_settings':
             assetManager::create()->setData('widget', $widget_data)->setData('forms', $this->xforms_model->get_forms())->renderAdmin('widget_settings');
             break;
         case 'update_settings':
             $this->form_validation->set_rules('form_id', 'Форма', 'required');
             if ($this->form_validation->run($this) == FALSE) {
                 showMessage(validation_errors(), false, 'r');
             } else {
                 $data = ['form_id' => $this->input->post('form_id')];
                 $this->load->module('admin/widgets_manager')->update_config($widget_data['id'], $data);
                 showMessage(lang('amt_settings_saved', 'xforms'));
                 if ($this->input->post('action') == 'tomain') {
                     pjax('/admin/widgets_manager/index');
                 }
             }
             break;
         case 'install_defaults':
             $this->load->module('admin/widgets_manager')->update_config($widget_data['id'], $this->defaults);
             break;
     }
 }
开发者ID:pulse-studio,项目名称:xforms,代码行数:32,代码来源:xforms_widgets.php

示例3: latest_fotos_configure

 public function latest_fotos_configure($action = 'show_settings', $widget_data = array())
 {
     if ($this->dx_auth->is_admin() == FALSE) {
         exit;
     }
     switch ($action) {
         case 'show_settings':
             //$this->display_tpl('latest_fotos_form', array('widget' => $widget_data));
             $this->render('latest_fotos_form', array('widget' => $widget_data));
             break;
         case 'update_settings':
             $this->load->library('Form_validation');
             $this->form_validation->set_rules('limit', lang("Image limit", 'gallery'), 'trim|required|integer');
             if ($this->form_validation->run($this) == FALSE) {
                 showMessage(validation_errors(), false, 'r');
                 exit;
             }
             $data = array('limit' => $_POST['limit'], 'order' => $_POST['order']);
             $this->load->module('admin/widgets_manager')->update_config($widget_data['id'], $data);
             showMessage(lang("Settings have been saved", 'gallery'));
             if ($_POST['action'] == 'tomain') {
                 pjax('/admin/widgets_manager/index');
             }
             break;
         case 'install_defaults':
             $data = array('limit' => 5, 'order' => 'latest');
             $this->load->module('admin/widgets_manager')->update_config($widget_data['id'], $data);
             break;
     }
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:30,代码来源:gallery_widgets.php

示例4: edit

 public function edit($id, $locale = null)
 {
     if (null === $locale) {
         $locale = chose_language();
     }
     $model = $this->email->getTemplateById($id, $locale);
     if (!$model) {
         $this->load->module('core');
         $this->core->error_404();
         exit;
     }
     $variables = unserialize($model['variables']);
     if ($_POST) {
         if ($this->email->edit($id, array(), $locale)) {
             showMessage(lang('Template edited', 'cmsemail'));
             if ($this->input->post('action') == 'tomain') {
                 pjax('/admin/components/cp/cmsemail/index');
             }
         } else {
             showMessage($this->email->errors, '', 'r');
         }
     } else {
         \CMSFactory\assetManager::create()->setData('locale', $locale)->setData('languages', $this->db->get('languages')->result_array())->setData('model', $model)->setData('variables', $variables)->registerScript('email', TRUE)->renderAdmin('edit');
     }
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:25,代码来源:admin.php

示例5: update_settings

 /**
  * Update settings from POST
  * @param $_POST
  * @author A.Gula <a.gula@imagecms.net>
  * @copyright (c) 2013, ImageCMS
  */
 public function update_settings()
 {
     $result = array_map('trim', $_POST);
     /** Save input data */
     $this->db->where('identif', 'socauth')->update('components', array('settings' => serialize($result)));
     showMessage(lang('Settings are saved', 'socauth'));
     pjax($_SERVER[HTTP_REFERER]);
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:14,代码来源:admin.php

示例6: updateSettings

 public function updateSettings()
 {
     $this->db->update('mod_sample_settings', array('value' => $this->input->post('mailTo')), array('name' => 'mailTo'));
     $this->db->update('mod_sample_settings', array('value' => $this->input->post('useEmailNotification')), array('name' => 'useEmailNotification'));
     $this->db->update('mod_sample_settings', array('value' => $this->input->post('key')), array('name' => 'key'));
     showMessage(lang('Settings saved', 'sample_module'));
     if ($_POST['action'] == 'back') {
         pjax('/admin/components/modules_table');
     }
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:10,代码来源:admin.php

示例7: __construct

 public function __construct()
 {
     if (!extension_loaded('soap')) {
         showMessage(lang('PHP SOAP extension is not installed'), '', 'r');
         pjax('/admin');
     }
     parent::__construct();
     $this->update = new Update();
     $this->load->library('lib_admin');
     $this->lib_admin->init_settings();
     ini_set("soap.wsdl_cache_enabled", "0");
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:12,代码来源:sys_update.php

示例8: update

 public function update()
 {
     //Yandex market settings
     if ($_POST['displayedCats']) {
         $this->db->set('value', serialize($this->input->post('displayedCats')));
         $this->db->where('id', 1);
         $this->db->update('mod_hotline_categories');
     } else {
         $this->db->set('value', '');
         $this->db->where('id', 1);
         $this->db->update('mod_hotline_categories');
     }
     pjax(site_url() . 'admin/components/cp/hotline');
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:14,代码来源:admin.php

示例9: delete_menu

 function delete_menu($name = null)
 {
     if ($name == null) {
         $name = $this->input->post('ids');
         foreach ($name as $n) {
             $this->menu->prepare_menu_array($n);
             $this->root_menu =& $this->menu->menu_array;
             $this->sub_menu =& $this->menu->sub_menu_array;
             $this->process_root($this->root_menu);
             //root menus array
             foreach ($this->root_menu as $menu) {
                 $this->menu_model->delete_menu_item($menu['id']);
             }
             //sub menus array
             foreach ($this->sub_menu as $menu) {
                 $this->menu_model->delete_menu_item($menu['id']);
             }
             //delete main menu
             $this->menu_model->delete_menu($n);
         }
         showMessage(lang("Menu removed", 'menu'));
         pjax('/admin/components/cp/menu');
     } else {
         $this->menu->prepare_menu_array($name);
         $this->root_menu =& $this->menu->menu_array;
         $this->sub_menu =& $this->menu->sub_menu_array;
         $this->process_root($this->root_menu);
         //root menus array
         foreach ($this->root_menu as $menu) {
             $this->menu_model->delete_menu_item($menu['id']);
         }
         //sub menus array
         foreach ($this->sub_menu as $menu) {
             $this->menu_model->delete_menu_item($menu['id']);
         }
         //delete main menu
         $this->menu_model->delete_menu($name);
         showMessage(lang("Menu removed", 'menu'));
         pjax('/admin/components/cp/menu');
     }
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:41,代码来源:admin.php

示例10: edit_trash

 function edit_trash($id)
 {
     $query = $this->db->get_where('trash', array('id' => $id));
     $this->template->add_array(array('trash' => $query->row()));
     if (count($this->db->get_where('components', array('name' => 'shop'))->row()) > 0) {
         $this->db->order_by("name", "asc");
         $query = $this->db->get('shop_products_i18n');
         $this->template->add_array(array('products' => $query->result()));
         $this->db->order_by("name", "asc");
         $query = $this->db->get('shop_category_i18n');
         $this->template->add_array(array('category' => $query->result()));
     }
     $this->db->order_by("name", "asc");
     $query = $this->db->get('category');
     $this->template->add_array(array('category_base' => $query->result()));
     if (!$this->ajaxRequest) {
         $this->display_tpl('edit_trash');
     }
     if ($_POST) {
         switch ($this->input->post('redirect_type')) {
             case "url":
                 $array = array('id' => $this->input->post('id'), 'trash_url' => $this->input->post('old_url'), 'trash_redirect_type' => $this->input->post('redirect_type'), 'trash_type' => $this->input->post('type'), 'trash_redirect' => prep_url($this->input->post('redirect_url')));
                 break;
             case "product":
                 $query = $this->db->get_where('shop_products', array('id' => $this->input->post('products')));
                 $url = $query->row();
                 $array = array('id' => $this->input->post('id'), 'trash_id' => $this->input->post('products'), 'trash_url' => $this->input->post('old_url'), 'trash_redirect_type' => $this->input->post('redirect_type'), 'trash_type' => $this->input->post('type'), 'trash_redirect' => site_url() . 'shop/product/' . $url->url);
                 break;
             case "category":
                 $query = $this->db->get_where('shop_category', array('id' => $this->input->post('category')));
                 $url = $query->row();
                 $array = array('id' => $this->input->post('id'), 'trash_id' => $this->input->post('category'), 'trash_url' => $this->input->post('old_url'), 'trash_redirect_type' => $this->input->post('redirect_type'), 'trash_type' => $this->input->post('type'), 'trash_redirect' => site_url() . 'shop/category/' . $url->full_path);
                 break;
             case "basecategory":
                 $query = $this->db->get_where('category', array('id' => $this->input->post('category_base')));
                 $url = $query->row();
                 $array = array('id' => $this->input->post('id'), 'trash_id' => $this->input->post('category_base'), 'trash_url' => $this->input->post('old_url'), 'trash_redirect_type' => $this->input->post('redirect_type'), 'trash_type' => $this->input->post('type'), 'trash_redirect' => site_url($this->cms_base->get_category_full_path($url->id)));
                 break;
             case "404":
                 $array = array('id' => $this->input->post('id'), 'trash_url' => $this->input->post('old_url'), 'trash_redirect_type' => $this->input->post('redirect_type'));
                 break;
             default:
                 $array = array('id' => $this->input->post('id'), 'trash_url' => $this->input->post('old_url'), 'trash_redirect_type' => $this->input->post('redirect_type'));
                 break;
         }
         $this->db->where('id', $this->input->post('id'));
         $this->db->update('trash', $array);
     }
     if ($this->input->post('action')) {
         showMessage(lang('Success', 'trash'));
     }
     if ($this->input->post('action') == 'exit') {
         pjax('/admin/components/init_window/trash');
     }
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:55,代码来源:admin.php

示例11: delete_group

 public function delete_group($id)
 {
     //todo: delete group
     $this->db->where('id', $id)->delete('content_field_groups');
     $this->db->where('group_id', $id)->update('content_fields_groups_relations', array('group_id' => '0'));
     $this->db->where('field_group', $id)->update('category', array('field_group' => '-1'));
     $this->db->where('category_field_group', $id)->update('category', array('category_field_group' => '-1'));
     $this->lib_admin->log(lang("Group deleted successfuly", "cfcm") . '. Id: ' . $id);
     showMessage(lang('Group deleted successfuly', 'cfcm'));
     pjax('/admin/components/cp/cfcm#fields_groups');
 }
开发者ID:RandomUsernameHere,项目名称:megainfo-corporate-cms,代码行数:11,代码来源:admin.php

示例12: upload_image

 /**
  * Upload image
  *
  * Upload image to album folder.
  *
  */
 public function upload_image($album_id = 0)
 {
     $temp_conf = $this->conf;
     if (is_array($_FILES['newPic'])) {
         // making transformation of $_FILES array for CodeIgniter's Upload class
         $this->transform_FILES('newPic');
         // configs for Upload
         $this->conf['upload_path'] = $this->conf['upload_path'] . $album_id;
         if (!is_dir($this->conf['upload_path'])) {
             mkdir($this->conf['upload_path']);
         }
         $config['upload_path'] = $this->conf['upload_path'];
         $config['allowed_types'] = $this->conf['allowed_types'];
         $config['max_size'] = 1024 * 1024 * $this->max_image_size;
         // init Upload
         $this->load->library('upload', $config);
         // saving each file
         $data = array();
         $i = 0;
         foreach ($_FILES as $fieldName => $filesData) {
             if (!$this->upload->do_upload($fieldName)) {
                 $error = $filesData['name'] . " - " . $this->upload->display_errors('', '') . "<br /> ";
                 $data['error'] .= $error;
             } else {
                 $data[$i] = array('upload_data' => $this->upload->data());
                 // Resize Image and create thumb
                 $this->resize_and_thumb($data[$i]['upload_data']);
                 $this->add_image($album_id, $data[$i]['upload_data']);
             }
             $buf = $this->conf['upload_path'];
             $this->conf = $temp_conf;
             $this->conf['upload_path'] = $buf;
             $i++;
         }
         if (isset($data['error'])) {
             showMessage($data['error'], '', 'r');
         } else {
             showMessage('Upload success');
             pjax('');
         }
     }
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:48,代码来源:admin.php

示例13: delete

 /**
  * Delete language
  */
 function delete()
 {
     //cp_check_perm('lang_delete');
     //$id = $this->input->post('lang_id');
     $id = $this->input->post('ids');
     if (is_array($id)) {
         foreach ($id as $item) {
             $lang = $this->cms_admin->get_lang($item);
             ($hook = get_hook('admin_language_delete')) ? eval($hook) : NULL;
             if ($lang['default'] == 1) {
                 showMessage(lang("This language has been used by default and can not be deleted", "admin"), lang("Blocking", "admin"), 'r');
                 exit;
             }
             $this->cms_admin->delete_lang($item);
             $this->deleteLanguageFolders($lang['locale']);
             // delete translated pages
             $this->db->where('lang', $item);
             $this->db->delete('content');
             $this->cache->delete('main_site_langs');
             $this->lib_admin->log(lang("Deleted the ID language", "admin") . " " . $item);
         }
     } else {
         $lang = $this->cms_admin->get_lang($id);
         ($hook = get_hook('admin_language_delete')) ? eval($hook) : NULL;
         if ($lang['default'] == 1) {
             showMessage(lang("This language has been used by default and can not be deleted", "admin"), lang("Blocking", "admin"), 'r');
             exit;
         }
         $this->cms_admin->delete_lang($id);
         // delete translated pages
         $this->db->where('lang', $id);
         $this->db->delete('content');
         $this->deleteLanguageFolders($lang['locale']);
         $this->cache->delete('main_site_langs');
         $this->lib_admin->log(lang("Deleted the ID language", "admin") . ' ' . $id);
     }
     showMessage(lang("the language has been deleted", "admin"));
     pjax('/admin/languages');
     //updateDiv('languages_page_w_content', site_url('admin/languages/'));
 }
开发者ID:RandomUsernameHere,项目名称:megainfo-corporate-cms,代码行数:43,代码来源:languages.php

示例14: createFile

 /**
  * Create po-file
  * @param type $module_template
  * @param type $type
  * @param type $lang
  */
 public function createFile($module_template, $type, $lang)
 {
     if ($_POST) {
         $lang = $this->input->post('locale');
         $type = $this->input->post('type');
         $module_template = $this->input->post('module_template');
         $settings = $this->input->post();
         $settings['lang'] = $lang;
         if ($this->poFileManager->create($module_template, $type, $lang, $settings)) {
             showMessage(lang('File was succcessfuly created.', 'translator'), lang('Message', 'translator'));
             if ($this->input->post('action') == 'showEdit') {
                 $this->setSession($module_template, $type, $lang);
                 pjax('/admin/components/init_window/translator');
             }
         } else {
             foreach ($this->poFileManager->getErrors() as $error) {
                 showMessage($error, lang('Error', 'translator'), 'r');
             }
         }
     } else {
         $this->getExistingLocales();
         \CMSFactory\assetManager::create()->registerScript('admin')->registerStyle('admin')->setData('langs', $this->langs)->renderAdmin('create');
         if ($module_template && $type && $lang) {
             switch ($type) {
                 case 'modules':
                     $names = $this->renderModulesNames($lang);
                     $file_name = $module_template;
                     break;
                 case 'templates':
                     $names = $this->renderTemplatesNames($lang);
                     $file_name = $module_template;
                     break;
                 case 'main':
                     $file_name = $type;
                     break;
             }
             $names = trim(preg_replace('/\\s\\s+/', ' ', $names));
             jsCode("Translator.start('','" . $names . "', '" . $type . "', '" . $lang . "', '" . $file_name . "');");
         }
     }
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:47,代码来源:admin.php

示例15: deletePermition

 public function deletePermition($id = null)
 {
     if (!$id) {
         return false;
     } else {
         $this->db->where('id', $id)->delete(self::$rbac_privileges_table . "_i18n");
         $this->db->where('id', $id)->delete(self::$rbac_privileges_table);
         showMessage("Привилегия удалена");
         pjax('/admin/rbac/roleEdit/1');
     }
 }
开发者ID:RandomUsernameHere,项目名称:megainfo-corporate-cms,代码行数:11,代码来源:Permitions.php


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