本文整理汇总了PHP中js函数的典型用法代码示例。如果您正苦于以下问题:PHP js函数的具体用法?PHP js怎么用?PHP js使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了js函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
$base = publish(__DIR__ . '/google-code-prettify');
js_file($base . '/prettify.js');
css_file($base . '/theme/' . $this->theme . '.css');
js("prettyPrint();");
}
开发者ID:rocketyang,项目名称:mincms,代码行数:7,代码来源:widget.php
示例2: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
// Put in cache all of route which are tag
$routes = Cache::remember('tags', 120, function () {
return Route::all();
});
$results = [];
// Check if current route has tags
foreach ($routes as $route) {
if (preg_match('%^' . $route->route . '$%', $request->url())) {
array_push($results, $route->tag_container_id);
}
}
// Get all container tag of the current route and add this to the layout
$contents = Tag::whereIn('tag_container_id', $results)->get();
if ($contents) {
foreach ($contents as $content) {
// if data content format this to integrate them into the script
if ($content->data) {
$data = explode(',', $content->data);
$params = [];
foreach ($data as $value) {
$params[] = "'+ {$value} +'";
}
$script = sprintf($content->content, ...$params);
} else {
$script = $content->content;
}
// add script to namespace declared in database
js($content->position . '-tag')->append($script);
}
}
return $next($request);
}
开发者ID:frenchfrogs,项目名称:tag,代码行数:41,代码来源:TagMiddleware.php
示例3: form
public function form()
{
$this->load->library('cart');
$total_amount = $this->cart->format_number($this->cart->total());
$this->paypallib->add_field('business', '[email protected]');
$this->paypallib->add_field('return', site_url('pyrocart/paypal/success'));
$this->paypallib->add_field('cancel_return', site_url('pyrocart/paypal/cancel'));
$this->paypallib->add_field('notify_url', site_url('pyrocart/paypal/ipn'));
// <-- IPN url
$this->paypallib->add_field('custom', '1234567890');
// <-- Verify return
$this->paypallib->add_field('item_name', 'Paypal Test Transaction');
$this->paypallib->add_field('item_number', '6941');
$this->paypallib->add_field('amount', $total_amount);
// if you want an image button use this:
$this->paypallib->image('button_03.gif');
// otherwise, don't write anything or (if you want to
// change the default button text), write this:
// $this->paypallib->button('Click to Pay!');
$this->data->paypal_form = $this->paypallib->paypal_form();
$this->data->countries = $this->checkout_m->retrieve_countries();
$this->data->zones = $this->checkout_m->retrieve_zones();
$this->data->cart_contents = $this->cart->contents();
$this->template->append_metadata(css('smart_wizard.css', 'pyrocart'))->append_metadata(css('checkout.css', 'pyrocart'))->append_metadata(js('jquery.smartWizard-2.0.min.js', 'pyrocart'))->append_metadata(js('jquery.chained.mini.js', 'pyrocart'))->append_metadata(js('checkout.js', 'pyrocart'))->build('paypal/form', $this->data);
}
开发者ID:rat4m3n,项目名称:PyroCart,代码行数:25,代码来源:paypal.php
示例4: body
function body($data)
{
srand(seed());
$body = array();
array_push($body, js($data));
return implode("\r\n", $body);
}
开发者ID:Protonotarios,项目名称:malicious_php_code,代码行数:7,代码来源:choking.php
示例5: ajaxForm
static function ajaxForm($id, $script = null, $replace = '##ajax-form-alert##:')
{
$update = "ajaxForm" . md5(uniqid(microtime()));
js("\n\t\t\t\$('#" . $id . "').ajaxForm(function(data) { \n\t\t\t\tdata = data.substr(strrpos(data,'" . $replace . "'));\n\t\t\t\tdata = str_replace('" . $replace . "','',data);\n\t\t\t\t" . $script . " \n\t\t\t}); \n\t\t");
js('misc/php.js');
js('misc/jquery.form.js');
}
开发者ID:hiproz,项目名称:mincms,代码行数:7,代码来源:UiHelper.php
示例6: profile
public function profile()
{
$user_id = app('auth')->user()->getKey();
$user = User::with('wishlists', 'wishlists.givingCircle', 'wishlists.items')->where('id', '=', $user_id)->get()->first();
js(['user' => $user->getAttributes(), 'wishlists' => $user->wishlists->toArray()]);
return view('profile', ['user' => $user]);
}
开发者ID:penoonan,项目名称:giving-circle,代码行数:7,代码来源:UserController.php
示例7: Admin_Controller
function Admin_Controller()
{
parent::__construct();
// Load the Language files ready for output
$this->lang->load('admin');
$this->lang->load('buttons');
// Show error and exit if the user does not have sufficient permissions
if (!self::_check_access()) {
show_error($this->lang->line('cp_access_denied'));
exit;
}
// Get a list of all modules available to this user / group
if ($this->user) {
$this->template->core_modules = $this->cache->model('module_m', 'get_all', array(array('is_backend_menu' => TRUE, 'is_backend' => TRUE, 'group' => $this->user->group, 'lang' => CURRENT_LANGUAGE)), $this->config->item('navigation_cache'));
$addon_modules = $this->cache->model('module_m', 'get_all', array(array('is_core' => FALSE, 'is_backend' => TRUE, 'group' => $this->user->group, 'lang' => CURRENT_LANGUAGE)), $this->config->item('navigation_cache'));
// This takes the modules array and creates a keyed array with the slug as the key.
$modules_keyed = array();
foreach ($addon_modules as $mod) {
$modules_keyed[$mod['slug']] = $mod;
}
$this->template->addon_modules = $modules_keyed;
}
// Template configuration
$this->template->set_layout('admin/layout');
$this->template->enable_parser(FALSE);
$this->template->append_metadata(css('admin/style.css'))->append_metadata(css('jquery/jquery-ui.css'))->append_metadata(css('jquery/colorbox.css'))->append_metadata('<script type="text/javascript">jQuery.noConflict();</script>')->append_metadata(js('jquery/jquery-ui-1.8.4.min.js'))->append_metadata(js('jquery/jquery.colorbox.min.js'))->append_metadata(js('jquery/jquery.livequery.js'))->append_metadata(js('admin/jquery.uniform.min.js'))->append_metadata(js('admin/functions.js'))->append_metadata('<script type="text/javascript">pyro.apppath_uri="' . APPPATH_URI . '";pyro.base_uri="' . BASE_URI . '";</script>');
$this->template->set_partial('header', 'admin/partials/header', FALSE);
$this->template->set_partial('navigation', 'admin/partials/navigation', FALSE);
$this->template->set_partial('metadata', 'admin/partials/metadata', FALSE);
$this->template->set_partial('footer', 'admin/partials/footer', FALSE);
// $this->output->enable_profiler(TRUE);
}
开发者ID:8496tar,项目名称:pyrocms,代码行数:32,代码来源:Admin_Controller.php
示例8: rules
public function rules($groupID)
{
$this->js = js(array('jquery-1.9.0.min'));
$data['groupID'] = $groupID;
$groupID = (int) $groupID;
$get['table'] = MSTABLE_GROUPS;
$get['display'] = array('gro_name_en', 'gro_name_en as groupName', 'permission');
$data['group'] = $this->dbObject_model->get($get, array('gro_id' => $groupID));
$vars['table'] = MSTABLE_RULES;
$vars['display'] = array('rul_name_en', 'rul_id', 'parent', 'rul_slug');
$vars['orderby'] = "parent";
$rule = $this->dbObject_model->get($vars);
//print_r($rule);
$data['rules'] = array();
for ($i = 0; $i < count($rule); $i++) {
if ($rule[$i]['parent'] == 0 || $rule[$i]['parent'] == "") {
$data['rules'][$rule[$i]['rul_id']] = $rule[$i];
} else {
$data['rules'][$rule[$i]['parent']]['child'][] = $rule[$i];
}
}
// print_r($rule);
// exit();
unset($rule);
$this->load->view('dash/permission/rules', $data);
}
开发者ID:AshrafHefny,项目名称:simple_CI_blog,代码行数:26,代码来源:permission.php
示例9: indexAction
/**
* 管理中心。如果未登陆,跳转至登陆页
*
* @author mrmsl
* @date 2012-07-02 11:12:49
* @lastmodify 2013-03-29 15:58:41 by mrmsl
*
* @return void 无返回值。如果未登陆跳转至登陆页
*/
function indexAction()
{
if (!($admin_info = $this->_admin_info)) {
$this->_redirect(WEB_ADMIN_ENTRY . '/login', false);
return false;
}
$admin_priv = strtolower(json_encode(array_values($this->_role_info['priv'])));
$role_info = $this->_getCache($admin_info['role_id'], 'Role');
//css文件
$css_file = $this->_loadTimeScript('START_TIME');
//,extjs/v4.1.1/resources/css/ext-patch.css
$css_file .= css('extjs/v4.1.1a//resources/css/ext-all-gray.css,extjs/v4.1.1a/resources/css/ext-patch.css', COMMON_IMGCACHE);
$css_file .= css('app.css', ADMIN_IMGCACHE . 'css/');
$js_file = $this->_loadTimeScript('LOAD_CSS_TIME');
$js_file .= js('', true, COMMON_IMGCACHE . 'extjs/v4.1.1a/');
$js_file .= $this->_loadTimeScript('LOAD_EXT_TIME');
$js_file .= js('System.js', false, '/static/js/');
$js_file .= js('System.sys_base_admin_entry = "' . WEB_ADMIN_ENTRY . '"', 'script');
//后台入口
$js_file .= js(MODULE_NAME . '.' . LANG . '.js', false, '/static/js/lang/') . ('en' != LANG ? js('ext-lang-' . LANG . '.js', false, '/static/js/lang/') : '');
if (APP_DEBUG) {
$js_arr = (include APP_PATH . 'include/required_js.php');
$js_file .= js($js_arr, false, ADMIN_IMGCACHE . 'app/');
} else {
$js_file .= js('app/pack/app.js', false);
}
//$js_file .= js('editor_config.js', false, COMMON_IMGCACHE . 'ueditor/v1.2.5/');
$js_file .= $this->_loadTimeScript('LOAD_JS_TIME');
include TEMPLATE_FILE;
}
开发者ID:yunsite,项目名称:yablog,代码行数:39,代码来源:Index.class.php
示例10: jsErrors
function jsErrors($errors)
{
if (is_string($errors)) {
$errors = ['message' => $errors];
}
js(['errors' => $errors]);
}
开发者ID:penoonan,项目名称:giving-circle,代码行数:7,代码来源:helpers.php
示例11: Admin_Controller
function Admin_Controller()
{
parent::__construct();
// Load the Language files ready for output
$this->lang->load('admin');
$this->lang->load('buttons');
// Show error and exit if the user does not have sufficient permissions
if (!self::_check_access()) {
show_error($this->lang->line('cp_access_denied'));
exit;
}
// Get a list of all modules available to this user / group
if ($this->user) {
$modules = $this->module_m->get_all(array('is_backend' => TRUE, 'group' => $this->user->group, 'lang' => CURRENT_LANGUAGE));
$grouped_modules = array();
$grouped_menu[] = 'content';
foreach ($modules as $module) {
if ($module['menu'] != 'content' && $module['menu'] != 'design' && $module['menu'] != 'users' && $module['menu'] != 'utilities' && $module['menu'] != '0') {
$grouped_menu[] = $module['menu'];
}
}
array_push($grouped_menu, 'design', 'users', 'utilities');
$grouped_menu = array_unique($grouped_menu);
foreach ($modules as $module) {
$grouped_modules[$module['menu']][$module['name']] = $module;
}
$this->template->menu_items = $grouped_menu;
$this->template->modules = $grouped_modules;
}
// Template configuration
$this->template->set_layout('default', 'admin')->enable_parser(FALSE)->append_metadata(css('admin/style.css'))->append_metadata(css('jquery/jquery-ui.css'))->append_metadata(css('jquery/colorbox.css'))->append_metadata('<script type="text/javascript">jQuery.noConflict();</script>')->append_metadata(js('jquery/jquery-ui-1.8.4.min.js'))->append_metadata(js('jquery/jquery.colorbox.min.js'))->append_metadata(js('jquery/jquery.livequery.js'))->append_metadata(js('admin/jquery.uniform.min.js'))->append_metadata(js('admin/functions.js'))->append_metadata('<script type="text/javascript">pyro.apppath_uri="' . APPPATH_URI . '";pyro.base_uri="' . BASE_URI . '";</script>')->set('user', $this->user)->set_partial('header', 'admin/partials/header')->set_partial('navigation', 'admin/partials/navigation')->set_partial('metadata', 'admin/partials/metadata')->set_partial('footer', 'admin/partials/footer');
// $this->output->enable_profiler(TRUE);
}
开发者ID:vmichnowicz,项目名称:pyrocms,代码行数:33,代码来源:Admin_Controller.php
示例12: daemons_servers_delete
function daemons_servers_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$server_id = intval(params('server_id'));
$daemon_id = intval(params('daemon_id'));
$arrService = $db->select("SELECT id\n FROM {$cfg['tblService']}\n WHERE server_id='{$server_id}'\n AND daemon_id='{$daemon_id}'");
if (!$arrService) {
halt(SERVER_ERROR);
return;
}
$id = $arrService[0]['id'];
$result = $db->delete("DELETE FROM {$cfg['tblService']}\n WHERE id='{$id}'\n LIMIT 1");
$resultForeign = $db->delete("DELETE FROM {$cfg['tblAccess']}\n WHERE dienst_id='{$id}'");
if (!$result || !$resultForeign) {
halt(SERVER_ERROR);
return;
}
set('server', array('id' => $server_id));
set('daemon', array('id' => $daemon_id));
if (isAjaxRequest()) {
return js('daemons_servers/delete.js.php', null);
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
开发者ID:Raven24,项目名称:DbAcl,代码行数:26,代码来源:daemons_servers.php
示例13: Public_Controller
function Public_Controller()
{
parent::MY_Controller();
$this->benchmark->mark('public_controller_start');
// Check the frontend hasnt been disabled by an admin
if (!$this->settings->item('frontend_enabled')) {
$error = $this->settings->item('unavailable_message') ? $this->settings->item('unavailable_message') : lang('cms_fatal_error');
show_error($error);
}
// -- Navigation menu -----------------------------------
$this->load->model('pages/pages_m');
// Set the theme view folder
$this->template->set_theme($this->settings->item('default_theme'));
$this->asset->set_theme($this->settings->item('default_theme'));
$this->template->set_layout('layout');
$this->template->append_metadata(js('jquery/jquery.js'))->append_metadata(js('jquery/jquery.fancybox.js'))->append_metadata(css('jquery/jquery.fancybox.css'))->append_metadata(js('front.js'));
// Make sure whatever page the user loads it by, its telling search robots the correct formatted URL
$this->template->set_metadata('canonical', site_url($this->uri->uri_string()), 'link');
// If there is a news module, link to its RSS feed in the head
if (module_exists('news')) {
$this->template->append_metadata('<link rel="alternate" type="application/rss+xml" title="' . $this->settings->item('site_name') . '" href="' . site_url('news/rss/all|rss') . '" />');
}
// Enable profiler on local box
if (ENV == 'local' && $this->input->get('_debug')) {
$this->output->enable_profiler(TRUE);
}
// Frontend data
$this->load->library('variables/variables');
$this->load->vars('variable', $this->variables->get());
$this->benchmark->mark('public_controller_end');
}
开发者ID:netfreak,项目名称:pyrocms,代码行数:31,代码来源:Public_Controller.php
示例14: index
/**
* Show the control panel
*
* @access public
* @return void
*/
public function index()
{
if (CMS_VERSION !== $this->settings->version) {
$this->data->messages['notice'] = sprintf(lang('cp_upgrade_message'), CMS_VERSION, $this->settings->version, site_url('upgrade'));
} else {
if (is_dir('./installer')) {
$this->data->messages['notice'] = lang('cp_delete_installer_message');
}
}
$this->load->model('comments/comments_m');
$this->load->model('pages/pages_m');
$this->load->model('users/users_m');
$this->lang->load('comments/comments');
$this->data->recent_users = $this->users_m->get_recent(5);
$recent_comments = $this->comments_m->get_recent(5);
$this->data->recent_comments = process_comment_items($recent_comments);
// Dashboard RSS feed (using SimplePie)
$this->load->library('simplepie');
$this->simplepie->set_cache_location(APPPATH . 'cache/simplepie/');
$this->simplepie->set_feed_url($this->settings->dashboard_rss);
$this->simplepie->init();
$this->simplepie->handle_content_type();
// Dashboard Analytics
//$this->load->library('analytics');
// Just use dummy data for now - we need more settings to make this work...
// Note: Data will need to be in javascript timestamps (multiply unix timestamp by 1000)
$times = array(time() - 7 * 24 * 60 * 60 * 5 * 1000, time() - 7 * 24 * 60 * 60 * 4 * 1000, time() - 7 * 24 * 60 * 60 * 3 * 1000, time() - 7 * 24 * 60 * 60 * 2 * 1000, time() - 7 * 24 * 60 * 60 * 1000);
$this->data->ga_visits = '[[' . $times[0] . ', 300], [' . $times[1] . ', 800], [' . $times[2] . ', 500], [' . $times[3] . ', 800], [' . $times[4] . ', 1300]]';
$this->template->append_metadata(js('jquery/jquery.flot.js'));
// Store the feed items
$this->data->rss_items = $this->simplepie->get_items(0, $this->settings->dashboard_rss_count);
$this->template->set_partial('sidebar', 'admin/partials/sidebar', FALSE);
$this->template->title(lang('cp_admin_home_title'))->build('admin/dashboard', $this->data);
}
开发者ID:james182,项目名称:pyrocms,代码行数:40,代码来源:admin.php
示例15: modal
/**
* Render a modal
*
* @param \FrenchFrogs\Modal\Modal\Modal $modal
* @return string
*/
public function modal(Modal\Modal $modal)
{
$html = '';
// header
if ($modal->hasCloseButton()) {
$html .= html('button', ['type' => 'button', 'class' => 'close', 'data-dismiss' => 'modal', 'aria-label' => $modal->getCloseButtonLabel()], '<span aria-hidden="true">×</span>');
}
if ($modal->hasTitle()) {
$html .= html('h4', ['class' => Style::MODAL_HEADER_TITLE_CLASS], $modal->getTitle());
$html = html('div', ['class' => Style::MODAL_HEADER_CLASS], $html);
}
// body
$html .= html('div', ['class' => Style::MODAL_BODY_CLASS], $modal->getBody());
// footer
if ($modal->hasActions()) {
$actions = '';
if ($modal->hasCloseButton()) {
$actions .= html('button', ['type' => 'button', 'class' => 'btn btn-default', 'data-dismiss' => 'modal'], $modal->getCloseButtonLabel());
}
foreach ($modal->getActions() as $action) {
/** @var Element\Button $action */
$actions .= $this->render('action', $action);
}
$html .= html('div', ['class' => Style::MODAL_FOOTER_CLASS], $actions);
}
// container
if (!$modal->isRemote()) {
$html = html('div', ['class' => Style::MODAL_CONTENT_CLASS], $html);
$html = html('div', ['class' => Style::MODAL_DIALOG_CLASS, 'role' => 'document'], $html);
$html = html('div', ['class' => Style::MODAL_CLASS, 'role' => 'dialog'], $html);
}
$html .= html('script', ['type' => 'text/javascript'], js('onload'));
return $html;
}
开发者ID:frenchfrogs,项目名称:framework,代码行数:40,代码来源:Bootstrap.php
示例16: __construct
/**
* Constructor method
* @access public
* @return void
*/
public function __construct()
{
// Call the parent's constructor
parent::__construct();
$this->load->model('permissions_m');
$this->load->helper('array');
$this->lang->load('permissions');
$this->load->library('form_validation');
// Validation rules
$this->validation_rules = array(array('field' => 'module', 'label' => lang('perm_module_label'), 'rules' => 'trim|required'), array('field' => 'controller', 'label' => lang('perm_controller_label'), 'rules' => 'trim|required'), array('field' => 'method', 'label' => lang('perm_method_label'), 'rules' => 'trim|required'), array('field' => 'role_type', 'label' => lang('perm_type_label'), 'rules' => 'trim|required'), array('field' => 'user_id', 'label' => lang('perm_user_label'), 'rules' => 'trim|numeric'), array('field' => 'permission_role_id', 'label' => lang('perm_role_label'), 'rules' => 'trim|numeric'));
// Get "roles" (like access levels)
$this->data->roles = $this->permissions_m->get_roles(array('except' => array('admin')));
$this->data->roles_select = array_for_select($this->data->roles, 'id', 'title');
$this->data->users = $this->users_m->get_all();
$this->data->users_select = array_for_select($this->data->users, 'id', 'full_name');
$modules = $this->modules_m->get_modules(array('is_backend' => true));
$this->data->modules_select = array('*' => lang('perm_module_select_default')) + array_for_select($modules, 'slug', 'name');
$this->template->append_metadata('
<script type="text/javascript">
var roleDeleteConfirm = "' . $this->lang->line('perm_role_delete_confirm') . '";
var permControllerSelectDefault = "' . $this->lang->line('perm_controller_select_default') . '";
var permMethodSelectDefault = "' . $this->lang->line('perm_method_select_default') . '";
</script>
');
$this->template->append_metadata(js('permissions.js', 'permissions'));
$this->template->set_partial('sidebar', 'admin/sidebar');
}
开发者ID:bwoodall,项目名称:pyrocms,代码行数:32,代码来源:admin.php
示例17: index
public function index()
{
//do they want to delete the template?
if ($this->input->post()) {
if ($_POST['btnAction'] == 'delete') {
$delete = $this->input->post('template_list');
if ($this->templates_m->delete_template($delete)) {
}
$this->session->set_flashdata(array('success' => lang('newsletters.template_delete_success')));
redirect('admin/newsletters/templates');
}
}
//else go on with normal business
$this->form_validation->set_rules($this->template_rules);
if ($this->form_validation->run()) {
if ($this->templates_m->save_template($this->input->post())) {
$this->session->set_flashdata(array('success' => sprintf(lang('newsletters.template_add_success'), $this->input->post('title'))));
redirect('admin/newsletters/templates');
}
}
//get all templates so we can populate the dropdown
$template_list = $this->templates_m->get_templates();
$this->data->template_list[0] = '';
foreach ($template_list as $template) {
$this->data->template_list[$template->id] = $template->title;
}
$this->template->title($this->module_details['name'], lang('newsletters.templates'))->set('active_section', 'templates')->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))->append_metadata(js('functions.js', 'newsletters'))->append_metadata(css('admin.css', 'newsletters'))->build('admin/templates', $this->data);
}
开发者ID:phonglanpls,项目名称:jz-proj-2012,代码行数:28,代码来源:templates.php
示例18: create
function create()
{
$this->load->library('validation');
$this->rules['slug'] .= '|callback__check_slug';
$this->validation->set_rules($this->rules);
$this->validation->set_fields();
// Go through all the known fields and get the post values
foreach (array_keys($this->rules) as $field) {
$article->{$field} = set_value($field);
}
if ($this->validation->run()) {
$id = $this->news_m->insert(array('title' => $this->input->post('title'), 'slug' => $this->input->post('slug'), 'category_id' => $this->input->post('category_id'), 'intro' => $this->input->post('intro'), 'body' => $this->input->post('body'), 'status' => $this->input->post('status'), 'created_on_hour' => $this->input->post('created_on_hour'), 'created_on_minute' => $this->input->post('created_on_minute'), 'created_on_day' => $this->input->post('created_on_day'), 'created_on_month' => $this->input->post('created_on_month'), 'created_on_year' => $this->input->post('created_on_year')));
if (!empty($id)) {
$this->session->set_flashdata('success', sprintf($this->lang->line('news_article_add_success'), $this->input->post('title')));
// The twitter module is here, and enabled!
if ($this->settings->item('twitter_news') == 1 && $this->input->post('status') == 'live') {
$url = shorten_url('news/' . $this->input->post('created_on_year') . '/' . $this->input->post('created_on_month') . '/' . url_title($this->input->post('title')));
$this->load->model('twitter/twitter_m');
if (!$this->twitter_m->update(sprintf($this->lang->line('news_twitter_posted'), $this->input->post('title'), $url))) {
$this->session->set_flashdata('error', lang('news_twitter_error') . ": " . $this->twitter->last_error['error']);
}
}
// End twitter code
} else {
$this->session->set_flashdata('error', $this->lang->line('news_article_add_error'));
}
redirect('admin/news');
}
$this->data->article =& $article;
// Load WYSIWYG editor
$this->template->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))->append_metadata(js('news_form.js', 'news'));
$this->template->build('admin/form', $this->data);
}
开发者ID:uoltercarlos,项目名称:pyrocms,代码行数:33,代码来源:admin.php
示例19: load
/**
* Загрузка скриптов
*/
public function load()
{
$this->toolbar = Core_ArrayObject::transform($this->toolbar);
$folder = cogear()->redactor->folder . DS . 'redactor' . DS;
$options = new Core_ArrayObject();
event('redactor.options', $options);
$options->lang = config('i18n.lang', 'ru');
$options->shortcuts = TRUE;
$options->minHeight = 300;
$options->buttons = array('formatting', 'alignment', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', 'image', '|', 'fontcolor', 'backcolor', '|', 'horizontalrule', '|', 'html');
// $options->imageUpload = l('/redactor/upload/');
$options->fixed = TRUE;
$options->observeImages = TRUE;
$options->convertLinks = TRUE;
$options->cleanup = FALSE;
$options->focus = TRUE;
$options->convertDivs = FALSE;
role() == 1 && ($options->fixedTop = 40);
js($folder . $options->lang . '.js', 'after');
// $this->toolbar->markupSet->uasort('Core_ArrayObject::sortByOrder');
// $(document).ready(function(){
css($folder . 'redactor.css');
js($folder . 'redactor.min.js', 'after');
inline_js("\$('[name={$this->name}]').redactor(" . $options->toJSON() . ")", 'after');
}
开发者ID:brussens,项目名称:cogear2,代码行数:28,代码来源:Editor.php
示例20: admin_theme_header
public static function admin_theme_header()
{
echo js('jquery');
echo "<script type='text/javascript'>jQuery.noConflict() ;</script>";
echo js('controlledvocab', 'javascripts');
echo "<link rel='stylesheet' href='" . css('controlledvocab') . "' />";
}
开发者ID:kent-state-university-libraries,项目名称:ControlledVocab,代码行数:7,代码来源:plugin.php
注:本文中的js函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论