本文整理汇总了PHP中ctools_add_js函数的典型用法代码示例。如果您正苦于以下问题:PHP ctools_add_js函数的具体用法?PHP ctools_add_js怎么用?PHP ctools_add_js使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ctools_add_js函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_meta
function add_meta()
{
ctools_include('display-edit', 'panels');
ctools_include('content');
if (empty($this->display->cache_key)) {
$this->cache = panels_edit_cache_get_default($this->display);
}
// @todo we may need an else to load the cache, but I am not sure we
// actually need to load it if we already have our cache key, and doing
// so is a waste of resources.
ctools_include('cleanstring');
$this->clean_key = ctools_cleanstring($this->display->cache_key);
panels_ipe_get_cache_key($this->clean_key);
ctools_include('ajax');
ctools_include('modal');
ctools_modal_add_js();
ctools_add_css('panels_dnd', 'panels');
ctools_add_css('panels_admin', 'panels');
ctools_add_js('panels_ipe', 'panels_ipe');
ctools_add_css('panels_ipe', 'panels_ipe');
$settings = array('formPath' => url($this->get_url('save-form')));
drupal_add_js(array('PanelsIPECacheKeys' => array($this->clean_key)), 'setting');
drupal_add_js(array('PanelsIPESettings' => array($this->clean_key => $settings)), 'setting');
jquery_ui_add(array('ui.draggable', 'ui.droppable', 'ui.sortable'));
parent::add_meta();
}
示例2: add_meta
function add_meta()
{
ctools_include('display-edit', 'panels');
ctools_include('content');
if (empty($this->display->cache_key)) {
$this->cache = panels_edit_cache_get_default($this->display);
}
// @todo we may need an else to load the cache, but I am not sure we
// actually need to load it if we already have our cache key, and doing
// so is a waste of resources.
ctools_include('cleanstring');
$this->clean_key = ctools_cleanstring($this->display->cache_key);
$button = array('#type' => 'link', '#title' => t('Customize this page'), '#href' => $this->get_url('save_form'), '#id' => 'panels-ipe-customize-page', '#attributes' => array('class' => array('panels-ipe-startedit', 'panels-ipe-pseudobutton')), '#ajax' => array('progress' => 'throbber', 'ipe_cache_key' => $this->clean_key), '#prefix' => '<div class="panels-ipe-pseudobutton-container">', '#suffix' => '</div>');
panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-startedit', $button);
// @todo this actually should be an IPE setting instead.
if (user_access('change layouts in place editing')) {
$button = array('#type' => 'link', '#title' => t('Change layout'), '#href' => $this->get_url('change_layout'), '#attributes' => array('class' => array('panels-ipe-change-layout', 'panels-ipe-pseudobutton', 'ctools-modal-layout')), '#ajax' => array('progress' => 'throbber', 'ipe_cache_key' => $this->clean_key), '#prefix' => '<div class="panels-ipe-pseudobutton-container">', '#suffix' => '</div>');
panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-change-layout', $button);
}
ctools_include('ajax');
ctools_include('modal');
ctools_modal_add_js();
ctools_add_css('panels_dnd', 'panels');
ctools_add_css('panels_admin', 'panels');
ctools_add_js('panels_ipe', 'panels_ipe');
ctools_add_css('panels_ipe', 'panels_ipe');
drupal_add_js(array('PanelsIPECacheKeys' => array($this->clean_key)), 'setting');
drupal_add_library('system', 'ui.draggable');
drupal_add_library('system', 'ui.droppable');
drupal_add_library('system', 'ui.sortable');
parent::add_meta();
}
示例3: __construct
public function __construct()
{
ctools_include('modal');
ctools_include('ajax');
ctools_modal_add_js();
ctools_add_js("ajax-responder");
}
示例4: add_meta
function add_meta()
{
ctools_include('display-edit', 'panels');
ctools_include('content');
if (empty($this->display->cache_key)) {
$this->cache = panels_edit_cache_get_default($this->display);
}
// @todo we may need an else to load the cache, but I am not sure we
// actually need to load it if we already have our cache key, and doing
// so is a waste of resources.
ctools_include('cleanstring');
$this->clean_key = ctools_cleanstring($this->display->cache_key);
$button = theme('panels_ipe_edit_button', array('class' => 'panels-ipe-startedit', 'text' => t('Customize this page')));
panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-startedit', $button);
// panels_ipe_get_cache_key($this->clean_key);
ctools_include('ajax');
ctools_include('modal');
ctools_modal_add_js();
ctools_add_css('panels_dnd', 'panels');
ctools_add_css('panels_admin', 'panels');
ctools_add_js('panels_ipe', 'panels_ipe');
ctools_add_css('panels_ipe', 'panels_ipe');
$settings = array('formPath' => url($this->get_url('save-form')));
drupal_add_js(array('PanelsIPECacheKeys' => array($this->clean_key)), 'setting');
drupal_add_js(array('PanelsIPESettings' => array($this->clean_key => $settings)), 'setting');
drupal_add_library('system', 'ui.draggable');
drupal_add_library('system', 'ui.droppable');
drupal_add_library('system', 'ui.sortable');
// drupal_add_js('misc/ui/jquery.ui.draggable.min.js');
// drupal_add_js('misc/ui/jquery.ui.droppable.min.js');
// drupal_add_js('misc/ui/jquery.ui.sortable.min.js');
// jquery_ui_add(array('ui.draggable', 'ui.droppable', 'ui.sortable'));
parent::add_meta();
}
示例5: add_meta
function add_meta() {
parent::add_meta();
if ($this->admin) {
ctools_include('ajax');
ctools_include('modal');
ctools_modal_add_js();
ctools_add_js('panels-base', 'panels');
ctools_add_js('display_editor', 'panels');
ctools_add_css('panels_dnd', 'panels');
ctools_add_css('panels_admin', 'panels');
}
}
示例6: init
function init($plugin)
{
parent::init($plugin);
finder_inc('finder', 'finder_ui');
ctools_include('ajax');
drupal_add_css(drupal_get_path('module', 'finder_ui') . '/finder_ui.css');
// These must be added up front because of a situation where all dropbuttons
// start as ordinary buttons but then get ajaxed to dropbuttons.
ctools_add_js('dropbutton');
ctools_add_css('dropbutton');
$modal_options = array('opacity' => 0.7, 'background' => '#000');
drupal_add_js(array('finder-modal-style' => array('modalSize' => array('type' => 'fixed', 'width' => 1024, 'height' => 576, 'contentRight' => 0), 'modalTheme' => 'FinderUIModal', 'modalOptions' => $modal_options, 'closeImage' => '')), 'setting');
drupal_add_js(drupal_get_path('module', 'finder_ui') . '/finder_ui.js');
}
示例7: entityForm
/**
* Overrides EntityInlineEntityFormController::entityForm().
*
* Copied from fieldable_panels_panes_entity_edit_form().
*/
public function entityForm($entity_form, &$form_state)
{
// Make the other form items dependent upon it.
ctools_include('dependent');
ctools_add_js('dependent');
$entity = $entity_form['#entity'];
$entity_type = 'fieldable_panels_pane';
list(, , $bundle) = entity_extract_ids($entity_type, $entity);
// Map these properties for entity translations.
$entity_form['#entity_type'] = array('#type' => 'value', '#value' => $entity->bundle);
$form_state['fieldable_panels_pane'] = $entity_form['#entity'];
$entity_form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $entity->title, '#weight' => -10);
$entity_form['language'] = array('#type' => 'value', '#value' => $entity->language);
$entity_form['link'] = array('#weight' => -10);
$entity_form['link']['link'] = array('#title' => t('Make title a link'), '#type' => 'checkbox', '#default_value' => $entity->link, '#description' => t('Check here to make the title link to another page.'), '#id' => 'edit-link');
$entity_form['link']['path'] = array('#type' => 'textfield', '#title' => t('Path'), '#description' => t('The path for this link. This can be an internal Drupal path such as %add-node or an external URL such as %drupal. Enter %front to link to the front page.', array('%front' => '<front>', '%add-node' => 'node/add', '%drupal' => 'http://drupal.org')), '#dependency' => array('edit-link' => array(1)), '#default_value' => $entity->path);
$entity_form['reusable'] = array('#weight' => 10);
$entity_form['revision'] = array('#weight' => 11);
if (empty($entity->fpid)) {
$entity_form['revision']['#access'] = FALSE;
}
$entity_form['reusable']['reusable'] = array('#type' => 'checkbox', '#title' => t('Make this entity reusable'), '#default_value' => $entity->reusable, '#id' => 'edit-reusable');
$entity_form['reusable']['category'] = array('#type' => 'textfield', '#title' => t('Category'), '#description' => t('The category this content will appear in the "Add content" modal. If left blank the category will be "Miscellaneous".'), '#dependency' => array('edit-reusable' => array(1)), '#default_value' => $entity->category);
$entity_form['reusable']['admin_title'] = array('#type' => 'textfield', '#title' => t('Administrative title'), '#description' => t('The name this content will appear in the "Add content" modal.'), '#dependency' => array('edit-reusable' => array(1)), '#default_value' => $entity->admin_title);
$entity_form['reusable']['admin_description'] = array('#type' => 'textarea', '#title' => t('Administrative description'), '#description' => t('A description of what this content is, does or is for, for administrative use.'), '#dependency' => array('edit-reusable' => array(1)), '#default_value' => $entity->admin_description);
$entity_form['revision']['revision'] = array('#type' => 'checkbox', '#title' => t('Create new revision'), '#default_value' => 1, '#id' => 'edit-revision');
if (!user_access('administer fieldable panels panes') || empty($entity->fpid) || $entity->vid != $entity->current_vid) {
$form['revision']['revision']['#disabled'] = TRUE;
$form['revision']['revision']['#value'] = TRUE;
}
$entity_form['revision']['log'] = array('#type' => 'textarea', '#title' => t('Log message'), '#description' => t('Provide an explanation of the changes you are making. This will help other authors understand your motivations.'), '#dependency' => array('edit-revision' => array(1)), '#default_value' => '');
$langcode = entity_language('fieldable_panels_pane', $entity);
field_attach_form('fieldable_panels_pane', $entity, $entity_form, $form_state, $langcode);
// _field_extra_fields_pre_render() doesn't execute properly, so manually
// set the weights.
$extra_fields = field_info_extra_fields($entity_type, $bundle, 'form');
foreach ($extra_fields as $name => $settings) {
if (isset($entity_form[$name])) {
$entity_form[$name]['#weight'] = $settings['weight'];
}
}
return $entity_form;
}
开发者ID:michael-wojcik,项目名称:open_eggheads,代码行数:48,代码来源:FieldablePanelsPaneInlineEntityFormController.class.php
示例8: render_entity
/**
* Render the panels display for a given panelizer entity.
*
* @param stdClass $entity
* A fully-loaded entity object controlled by panelizer.
* @param array $args
* Optional array of arguments to pass to the panels display.
* @param string $address
* An optional address to send to the renderer to use for addressable
* content.
* @param array $extra_contexts
* An optional array of extra context objects that will be added to the
* display.
*
* @return array
* If the entity isn't panelized, this returns NULL. Otherwise, it returns an
* associative array as meant for use with CTools with the following keys:
* - 'content': String containing the rendered panels display output.
* - 'no_blocks': Boolean defining if the panels display wants to hide core
* blocks or not when being rendered.
*/
function render_entity($entity, $view_mode, $langcode = NULL, $args = array(), $address = NULL, $extra_contexts = array())
{
if (empty($entity->panelizer[$view_mode]) || empty($entity->panelizer[$view_mode]->display)) {
return FALSE;
}
list($entity_id, $revision_id, $bundle) = entity_extract_ids($this->entity_type, $entity);
$panelizer = $entity->panelizer[$view_mode];
$display = $panelizer->display;
$display->context = $this->get_contexts($panelizer, $entity) + $extra_contexts;
$display->args = $args;
$display->css_id = $panelizer->css_id;
// This means the IPE will use our cache which means it will get appropriate
// allowed content should it be selected.
$display->cache_key = implode(':', array_filter(array('panelizer', $this->entity_type, $entity_id, $view_mode, $revision_id)));
// Check to see if there is any CSS.
if (!empty($panelizer->css)) {
ctools_include('css');
$filename = ctools_css_retrieve($display->cache_key);
if (!$filename) {
$filename = ctools_css_store($display->cache_key, $panelizer->css);
}
drupal_add_css($filename, array('group' => CSS_THEME));
}
if ($view_mode == 'page_manager') {
// We think this is handled as a page, so set the current page display.
panels_get_current_page_display($display);
}
// Allow applications to alter the panelizer and the display before rendering them.
drupal_alter('panelizer_pre_render', $panelizer, $display, $entity);
ctools_include('plugins', 'panels');
$renderer = panels_get_renderer($panelizer->pipeline, $display);
// If the IPE is enabled, but the user does not have access to edit
// the entity, load the standard renderer instead.
// Use class_parents so we don't try to autoload the class we are testing.
$parents = class_parents($renderer);
if (!empty($parents['panels_renderer_editor']) && (!$this->panelizer_access('content', $entity, $view_mode) && !$this->entity_access('update', $entity))) {
$renderer = panels_get_renderer_handler('standard', $display);
}
$renderer->address = $address;
$info = array('title' => $panelizer->display->get_title(), 'content' => panels_render_display($display, $renderer), 'no_blocks' => !empty($panelizer->no_blocks));
$info['classes_array'] = array();
if (!empty($panelizer->css_class)) {
foreach (explode(' ', $panelizer->css_class) as $class) {
$class = ctools_context_keyword_substitute($class, array(), $display->context);
if ($class) {
$info['classes_array'][] = drupal_html_class($class);
}
}
}
if (!empty($parents['panels_renderer_editor'])) {
$path = drupal_get_path('module', 'panelizer');
ctools_add_js('panelizer-ipe', 'panelizer');
drupal_add_js($path . "/js/panelizer-ipe.js", array('group' => JS_LIBRARY));
drupal_add_css($path . "/css/panelizer-ipe.css");
}
return $info;
}
示例9: asf_ajax_login_callback
function asf_ajax_login_callback($form, &$form_state)
{
// if errors, return the form
if (form_get_errors()) {
$msg = 'Sorry, unrecognized username or password.';
for ($i = 0; $i < count($_SESSION['messages']['error']); $i++) {
if (strpos($_SESSION['messages']['error'][$i], $msg) !== false) {
$_SESSION['messages']['error'][$i] = $msg;
break;
}
}
$form_state['rebuild'] = TRUE;
return $form;
}
// this performs the actual login
user_login_submit($form, $form_state);
// this performs a redirection
$path = $form_state["redirect"] . "/subscriptions";
ctools_include('ajax');
ctools_add_js('ajax-responder');
$commands[] = ctools_ajax_command_redirect($path);
print ajax_render($commands);
exit;
}
示例10: list_form
/**
* Create the filter/sort form at the top of a list of exports.
*
* This handles the very default conditions, and most lists are expected
* to override this and call through to parent::list_form() in order to
* get the base form and then modify it as necessary to add search
* gadgets for custom fields.
*/
function list_form(&$form, &$form_state)
{
// This forces the form to *always* treat as submitted which is
// necessary to make it work.
$form['#token'] = FALSE;
if (empty($form_state['input'])) {
$form["#post"] = TRUE;
}
// Add the 'q' in if we are not using clean URLs or it can get lost when
// using this kind of form.
if (!variable_get('clean_url', FALSE)) {
$form['q'] = array('#type' => 'hidden', '#value' => $_GET['q']);
}
$all = array('all' => t('- All -'));
$form['top row'] = array('#prefix' => '<div class="ctools-export-ui-row ctools-export-ui-top-row clear-block">', '#suffix' => '</div>');
$form['bottom row'] = array('#prefix' => '<div class="ctools-export-ui-row ctools-export-ui-bottom-row clear-block">', '#suffix' => '</div>');
$form['top row']['storage'] = array('#type' => 'select', '#title' => t('Storage'), '#options' => $all + array(t('Normal') => t('Normal'), t('Default') => t('Default'), t('Overridden') => t('Overridden')), '#default_value' => 'all');
$form['top row']['disabled'] = array('#type' => 'select', '#title' => t('Enabled'), '#options' => $all + array('0' => t('Enabled'), '1' => t('Disabled')), '#default_value' => 'all');
$form['top row']['search'] = array('#type' => 'textfield', '#title' => t('Search'));
$form['bottom row']['order'] = array('#type' => 'select', '#title' => t('Sort by'), '#options' => $this->list_sort_options(), '#default_value' => 'disabled');
$form['bottom row']['sort'] = array('#type' => 'select', '#title' => t('Order'), '#options' => array('asc' => t('Up'), 'desc' => t('Down')), '#default_value' => 'asc');
$form['bottom row']['submit'] = array('#type' => 'submit', '#id' => 'ctools-export-ui-list-items-apply', '#value' => t('Apply'), '#attributes' => array('class' => 'ctools-use-ajax ctools-auto-submit-click'));
$form['bottom row']['reset'] = array('#type' => 'submit', '#id' => 'ctools-export-ui-list-items-apply', '#value' => t('Reset'), '#attributes' => array('class' => 'ctools-use-ajax'));
ctools_add_js('ajax-responder');
ctools_add_js('auto-submit');
drupal_add_js('misc/jquery.form.js');
$form['#prefix'] = '<div class="clear-block">';
$form['#suffix'] = '</div>';
$form['#attributes'] = array('class' => 'ctools-auto-submit-full-form');
}
示例11: ember_links__ctools_dropbutton
/**
* Overrides theme_links__ctools_dropbutton().
*
* This override adds a wrapper div so that we can maintain appropriate
* vertical spacing.
*/
function ember_links__ctools_dropbutton($variables)
{
// Check to see if the number of links is greater than 1;
// otherwise just treat this like a button.
if (!empty($variables['links'])) {
$is_drop_button = count($variables['links']) > 1;
// Add needed files
if ($is_drop_button) {
ctools_add_js('dropbutton');
ctools_add_css('dropbutton');
}
ctools_add_css('button');
// Provide a unique identifier for every button on the page.
static $id = 0;
$id++;
// Wrapping div
$class = 'ctools-no-js';
$class .= $is_drop_button ? ' ctools-dropbutton' : '';
$class .= ' ctools-button';
if (!empty($variables['class'])) {
$class .= $variables['class'] ? ' ' . implode(' ', $variables['class']) : '';
}
$output = '';
$output .= '<div class="' . $class . '" id="ctools-button-' . $id . '">';
// Add a twisty if this is a dropbutton
if ($is_drop_button) {
$variables['title'] = $variables['title'] ? check_plain($variables['title']) : t('open');
$output .= '<div class="ctools-link">';
if ($variables['image']) {
$output .= '<a href="#" class="ctools-twisty ctools-image">' . $variables['title'] . '</a>';
} else {
$output .= '<a href="#" class="ctools-twisty ctools-text">' . $variables['title'] . '</a>';
}
$output .= '</div>';
// ctools-link
}
// The button content
$output .= '<div class="ctools-content">';
// Check for attributes. theme_links expects an array().
$variables['attributes'] = !empty($variables['attributes']) ? $variables['attributes'] : array();
// Remove the inline and links classes from links if they exist.
// These classes are added and styled by Drupal core and mess up the default
// styling of any link list.
if (!empty($variables['attributes']['class'])) {
$classes = $variables['attributes']['class'];
foreach ($classes as $key => $class) {
if ($class === 'inline' || $class === 'links') {
unset($variables['attributes']['class'][$key]);
}
}
}
// Call theme_links to render the list of links.
$output .= theme_links(array('links' => $variables['links'], 'attributes' => $variables['attributes'], 'heading' => ''));
$output .= '</div>';
// ctools-content
$output .= '</div>';
// ctools-dropbutton
// Wrap the output in our container.
$output = '<div class="ctools-dropbutton-wrapper">' . $output . '</div>';
return $output;
} else {
return '';
}
}
示例12: ctools_include
<?php
/*
* @Megadrupal
* @Thanhhust
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
global $base_url;
ctools_include('modal');
ctools_include('ajax');
ctools_modal_add_js();
ctools_add_js('modal_forms_pop', 'md_block_custom');
if (function_exists('ctools_modal_text_button')) {
$login_pop = ctools_modal_text_button(t('Login'), 'fck_modals/nojs/login', t('Login'), 'mycoolmodulemodal login-link');
$register_pop = ctools_modal_text_button(t('Register'), 'fck_modals/nojs/register', t('Register'), 'mycoolmodulemodal register-link');
} else {
$login_pop = l(t('Login'), $base_url . '/user/login/', array('attributes' => array('class' => 'login-link')));
$register_pop = l(t('Register'), $base_url . '/user/register/', array('attributes' => array('class' => 'register-link')));
}
if ($logged_in) {
$user_id = $variables['user']->uid;
$user = user_load($user_id);
$user_url = $base_url . '/user/' . $user->uid;
$user_image_alt = isset($user->picture) ? $user->picture->alt : '';
?>
<div class="container-fluid">
<div class="header-account">
<div class="header-account-avatar">
<a href="<?php
示例13: ID
[uuid_1] == User: User UUID
[field_xbox_gamertag_1] == User: Xbox Gamertag
[field_youtube_link_1] == User: YouTube Channel
[field_tournament_status] == Content: Tournament Status
[field_match_status] == Content: Match Status
[field_match_status-value] == Raw value
%1 == Content: Match Challonge ID (field_match_challonge_id) title
!1 == Content: Match Challonge ID (field_match_challonge_id) input
*/
?>
<?php
ctools_include('modal');
ctools_include('ajax');
ctools_modal_add_js();
ctools_add_js('ajax-responder');
$sample_style = array('ctools-sample-style' => array('modalSize' => array('type' => 'fixed', 'width' => 450, 'height' => 400, 'addWidth' => 1, 'addHeight' => 0), 'modalOptions' => array('opacity' => 0.5, 'background-color' => '#000'), 'animation' => 'fadeIn'));
drupal_add_js($sample_style, 'setting');
?>
<div class="row">
<div class="pricing-table pricing-table__style3">
<!-- Team One Section-->
<div class="col-md-2">
<div class="plan popular style3" style="border-width: 1px;border-color: grey">
<header class="pricing-head">
<div class="circled">
开发者ID:harryboulderdash,项目名称:PlayGFC_2.0,代码行数:31,代码来源:views-view-fields--match-details--block.tpl.php