本文整理汇总了PHP中ctools_modal_add_js函数的典型用法代码示例。如果您正苦于以下问题:PHP ctools_modal_add_js函数的具体用法?PHP ctools_modal_add_js怎么用?PHP ctools_modal_add_js使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ctools_modal_add_js函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
ctools_include('modal');
ctools_include('ajax');
ctools_modal_add_js();
ctools_add_js("ajax-responder");
}
示例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: 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();
}
示例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: edit_form
function edit_form(&$form, &$form_state)
{
parent::edit_form($form, $form_state);
ctools_include('stack-admin', 'panels_frame');
ctools_include('plugins', 'panels');
ctools_include('ajax');
ctools_include('modal');
ctools_modal_add_js();
ctools_add_css('panels_dnd', 'panels');
ctools_add_css('panels-frame.ui-stack', 'panels_frame');
// Set the cache identifier and immediately set an object cache.
$form_state['cache_key'] = panels_frame_cache_key($form_state['item']->name);
if (is_object($cache = panels_frame_cache_get('stack', $form_state['cache_key']))) {
$form_state['item'] = $cache;
}
panels_frame_cache_set('stack', $form_state['cache_key'], $form_state['item']);
$form['info']['#type'] = 'container';
$form['info']['#attributes']['class'][] = 'stack-admin-info';
$form['frames'] = panels_frame_stack_edit_form(array(), $form_state);
$form['frames']['#type'] = 'container';
$form['frames']['#attributes']['class'][] = 'stack-admin-frames';
$form['buttons']['#type'] = 'container';
$form['buttons']['#attributes']['class'][] = 'stack-admin-buttons';
$form['info']['plugin'] = array('#type' => 'value', '#value' => 'stack');
}
示例6: 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_css('panels_ipe', 'panels_ipe');
// Add the JavaScript for the IPE. This must go as early as possible so
// that its behaviors run first, allowing it to clone parts of the DOM
// before other behaviors have been applied to them.
drupal_add_js(drupal_get_path('module', 'panels_ipe') . '/js/panels_ipe.js', array('group' => JS_LIBRARY, 'weight' => -1000));
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();
}
示例7: 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');
}
}
示例8: 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
示例9: hasta_preprocess_hybridauth_widget
function hasta_preprocess_hybridauth_widget(&$vars, $hook)
{
$element = $vars['element'];
$query = $element['#hybridauth_query'];
$element['#hybridauth_destination'] = trim($element['#hybridauth_destination']);
$element['#hybridauth_destination_error'] = trim($element['#hybridauth_destination_error']);
$destination = drupal_get_destination();
// Process destination; HTTP_REFERER is needed for widget in modals
// to return to the current page.
if ($element['#hybridauth_destination'] == '[HTTP_REFERER]' && isset($_SERVER['HTTP_REFERER'])) {
$query += array('destination' => $_SERVER['HTTP_REFERER']);
} elseif ($element['#hybridauth_destination']) {
$query += array('destination' => $element['#hybridauth_destination']);
} else {
$query += array('destination' => $destination['destination']);
}
if ($element['#hybridauth_destination_error'] == '[HTTP_REFERER]' && isset($_SERVER['HTTP_REFERER'])) {
$query += array('destination_error' => $_SERVER['HTTP_REFERER']);
} elseif ($element['#hybridauth_destination_error']) {
$query += array('destination_error' => $element['#hybridauth_destination_error']);
} else {
$query += array('destination_error' => $destination['destination']);
}
$providers = array();
if ($element['#hybridauth_widget_type'] == 'list') {
$class = array('hybridauth-widget-provider', 'button', 'btn-social', 'span-left');
$rel = array('nofollow');
foreach (hybridauth_get_enabled_providers() as $provider_id => $provider_name) {
$window_type = variable_get('hybridauth_provider_' . $provider_id . '_window_type', 'current');
$window_width = variable_get('hybridauth_provider_' . $provider_id . '_window_width', 800);
$window_height = variable_get('hybridauth_provider_' . $provider_id . '_window_height', 500);
$query_mod = $query;
$class_mod = $class;
$rel_mod = $rel;
$replace_provider = array('google' => 'googleplus');
$provider = strtolower($provider_name);
$class_icon = isset($replace_provider[$provider]) ? $replace_provider[$provider] : $provider;
$class_mod[] = $class_icon;
switch ($window_type) {
// Add Colorbox-specific things.
case 'colorbox':
$class_mod[] = 'colorbox-load';
$query_mod += array('width' => $window_width, 'height' => $window_height, 'iframe' => 'true');
break;
// Add Shadowbox specific settings.
// Add Shadowbox specific settings.
case 'shadowbox':
$rel_mod = array('shadowbox;width=' . $window_width . ';height=' . $window_height, 'nofollow');
break;
// Add fancyBox-specific settings.
// Add fancyBox-specific settings.
case 'fancybox':
$class_mod[] = 'fancybox';
$class_mod[] = 'fancybox.iframe';
$class_mod[] = '{width:' . $window_width . ',height:' . $window_height . '}';
break;
// Add Lightbox2-specific settings.
// Add Lightbox2-specific settings.
case 'lightbox2':
$rel_mod = array('lightframe[|width:' . $window_width . 'px; height:' . $window_height . 'px;]', 'nofollow');
break;
}
// Determine onclick behavior.
$onclick = '';
if ($element['#hybridauth_onclick'] === FALSE) {
} elseif (!empty($element['#hybridauth_onclick'])) {
$onclick = $element['#hybridauth_onclick'];
} elseif ($window_type == 'current') {
$class_mod[] = 'hybridauth-onclick-current';
} elseif ($window_type == 'popup') {
$class_mod[] = 'hybridauth-onclick-popup';
}
$text = theme('hybridauth_provider_icon', array('icon_pack' => $element['#hybridauth_widget_icon_pack'], 'provider_id' => $provider_id, 'provider_name' => $provider_name));
$path = 'hybridauth/window/' . $provider_id;
$url = url($path, array('query' => $query_mod));
if ($element['#hybridauth_widget_hide_links']) {
$path = 'user';
}
$options = array('html' => TRUE, 'query' => $query_mod, 'attributes' => array('title' => $provider_name, 'class' => $class_mod, 'rel' => $rel_mod, 'data-hybridauth-provider' => $provider_id, 'data-hybridauth-url' => $url, 'data-ajax' => 'false', 'data-hybridauth-width' => $window_width, 'data-hybridauth-height' => $window_height) + ($onclick ? array('onclick' => $onclick) : array()));
$providers[] = l($text, $path, $options);
}
} else {
$provider_id = 'none';
$class = array();
if ($element['#hybridauth_widget_use_overlay']) {
$class = array('ctools-use-modal', 'ctools-modal-hybridauthmodal');
ctools_include('modal');
ctools_modal_add_js();
$settings = array('hybridauthmodal' => array('modalSize' => array('type' => 'scale', 'width' => '400px', 'height' => '200px', 'addWidth' => 0, 'addHeight' => 0, 'contentRight' => 25, 'contentBottom' => 45), 'modalTheme' => 'HybridAuthModalDialog', 'modalOptions' => array('opacity' => 0.55, 'background' => '#000'), 'animation' => 'fadeIn', 'animationSpeed' => 'slow', 'closeText' => t('Close'), 'closeImage' => ''));
drupal_add_js($settings, 'setting');
}
$class = 'button btn-social span-left ' . strtolower($element['#hybridauth_widget_link_title']);
$providers[] = l($element['#hybridauth_widget_type'] == 'link' ? $element['#hybridauth_widget_link_text'] : theme('hybridauth_provider_icon', array('icon_pack' => $element['#hybridauth_widget_icon_pack'], 'provider_id' => $provider_id, 'provider_name' => $element['#hybridauth_widget_link_title'])), 'hybridauth/providers/nojs/' . $element['#hybridauth_widget_icon_pack'], array('html' => TRUE, 'query' => $query, 'attributes' => array('title' => $element['#hybridauth_widget_link_title'], 'class' => $class, 'rel' => array('nofollow'))));
}
_hybridauth_add_icon_pack_files($element['#hybridauth_widget_icon_pack']);
$vars['providers'] = $providers;
}