updated etxlink, ctools, colorbox, computed_field

This commit is contained in:
2019-05-13 17:51:14 +02:00
parent 33210e10f2
commit 2ffad14939
309 changed files with 4930 additions and 2655 deletions

View File

@@ -1,5 +1,9 @@
<?php
/**
* @file
*/
$plugin = array(
'schema' => 'stylizer',
'access' => 'administer stylizer',
@@ -42,4 +46,3 @@ $plugin = array(
),
),
);

View File

@@ -5,16 +5,18 @@
*/
class stylizer_ui extends ctools_export_ui {
function access($op, $item) {
public function access($op, $item) {
$access = parent::access($op, $item);
if ($op == 'add' && $access && empty($this->base_types)) {
// Make sure there are base styles defined.
$access = FALSE;
// Make sure there are base styles defined.
$access = FALSE;
}
return $access;
}
function list_form(&$form, &$form_state) {
public function list_form(&$form, &$form_state) {
ctools_include('stylizer');
parent::list_form($form, $form_state);
@@ -60,7 +62,8 @@ class stylizer_ui extends ctools_export_ui {
);
}
function list_sort_options() {
public function list_sort_options() {
return array(
'disabled' => t('Enabled, title'),
'title' => t('Title'),
@@ -71,7 +74,8 @@ class stylizer_ui extends ctools_export_ui {
);
}
function list_filter($form_state, $item) {
public function list_filter($form_state, $item) {
if (empty($form_state['style_plugins'][$item->settings['style_base']])) {
$this->style_plugin = array(
'name' => 'broken',
@@ -102,30 +106,37 @@ class stylizer_ui extends ctools_export_ui {
return parent::list_filter($form_state, $item);
}
function list_search_fields() {
public function list_search_fields() {
$fields = parent::list_search_fields();
$fields[] = 'plugin_title';
return $fields;
}
function list_build_row($item, &$form_state, $operations) {
// Set up sorting
public function list_build_row($item, &$form_state, $operations) {
// Set up sorting.
switch ($form_state['values']['order']) {
case 'disabled':
$this->sorts[$item->name] = empty($item->disabled) . $item->admin_title;
break;
case 'title':
$this->sorts[$item->name] = $item->admin_title;
break;
case 'name':
$this->sorts[$item->name] = $item->name;
break;
case 'type':
$this->sorts[$item->name] = $this->style_plugin['type'] . $item->admin_title;
break;
case 'base':
$this->sorts[$item->name] = $this->style_plugin['title'] . $item->admin_title;
break;
case 'storage':
$this->sorts[$item->name] = $item->type . $item->admin_title;
break;
@@ -154,7 +165,8 @@ class stylizer_ui extends ctools_export_ui {
);
}
function list_table_header() {
public function list_table_header() {
return array(
array('data' => t('Type'), 'class' => array('ctools-export-ui-type')),
array('data' => t('Name'), 'class' => array('ctools-export-ui-name')),
@@ -165,14 +177,16 @@ class stylizer_ui extends ctools_export_ui {
);
}
function init($plugin) {
public function init($plugin) {
ctools_include('stylizer');
$this->base_types = ctools_get_style_base_types();
parent::init($plugin);
}
function get_wizard_info(&$form_state) {
public function get_wizard_info(&$form_state) {
$form_info = parent::get_wizard_info($form_state);
ctools_include('stylizer');
@@ -219,7 +233,7 @@ class stylizer_ui extends ctools_export_ui {
* The stylizer wizard stores its stuff in slightly different places, so
* we have to find it and move it to the right place.
*/
function store_stylizer_info(&$form_state) {
public function store_stylizer_info(&$form_state) {
/*
foreach (array('name', 'admin_title', 'admin_description') as $key) {
if (!empty($form_state['values'][$key])) {
@@ -235,12 +249,14 @@ class stylizer_ui extends ctools_export_ui {
$form_state['item']->settings['name'] = $form_state['item']->name;
}
function edit_wizard_next(&$form_state) {
public function edit_wizard_next(&$form_state) {
$this->store_stylizer_info($form_state);
parent::edit_wizard_next($form_state);
}
function edit_wizard_finish(&$form_state) {
public function edit_wizard_finish(&$form_state) {
// These might be stored by the stylizer wizard, so we should clear them.
if (isset($form_state['settings']['old_settings'])) {
unset($form_state['settings']['old_settings']);
@@ -249,7 +265,8 @@ class stylizer_ui extends ctools_export_ui {
parent::edit_wizard_finish($form_state);
}
function edit_form_type(&$form, &$form_state) {
public function edit_form_type(&$form, &$form_state) {
foreach ($this->base_types as $module => $info) {
foreach ($info as $key => $base_type) {
$types[$module . '-' . $key] = $base_type['title'];
@@ -266,7 +283,9 @@ class stylizer_ui extends ctools_export_ui {
);
}
function edit_form_type_submit(&$form, &$form_state) {
public function edit_form_type_submit(&$form, &$form_state) {
list($form_state['item']->style_module, $form_state['item']->style_type) = explode('-', $form_state['values']['type']);
}
}

View File

@@ -2,13 +2,11 @@ name = Stylizer
description = Create custom styles for applications such as Panels.
core = 7.x
package = Chaos tool suite
version = CTOOLS_MODULE_VERSION
dependencies[] = ctools
dependencies[] = color
; Information added by Drupal.org packaging script on 2016-11-22
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2019-02-08
version = "7.x-1.15"
core = "7.x"
project = "ctools"
datestamp = "1479787162"
datestamp = "1549603691"

View File

@@ -1,5 +1,9 @@
<?php
/**
* @file
*/
/**
* Schema for stylizer.
*/

View File

@@ -2,7 +2,7 @@
/**
* @file
* Stylizer module
* Stylizer module.
*
* This module allows styles to be created and managed on behalf of modules
* that implement styles.
@@ -30,7 +30,7 @@ function stylizer_permission() {
*/
function stylizer_ctools_plugin_directory($module, $plugin) {
// Most of this module is implemented as an export ui plugin, and the
// rest is in ctools/includes/stylizer.inc
// rest is in ctools/includes/stylizer.inc.
if ($module == 'ctools' && $plugin == 'export_ui') {
return 'plugins/' . $plugin;
}
@@ -59,7 +59,7 @@ function stylizer_panels_dashboard_blocks(&$vars) {
'description' => t('Custom styles can be applied to Panel regions and Panel panes.'),
);
// Load all mini panels and their displays.
// Load all mini panels and their displays.
ctools_include('export');
ctools_include('stylizer');
$items = ctools_export_crud_load_all('stylizer');
@@ -122,14 +122,14 @@ function stylizer_theme() {
'path' => $plugin['path'],
);
// if no theme function exists, assume template.
// If no theme function exists, assume template.
if (!function_exists("theme_$plugin[theme]")) {
$theme[$plugin['theme']]['template'] = str_replace('_', '-', $plugin['theme']);
$theme[$plugin['theme']]['file'] = $plugin['file']; // for preprocess.
// For preprocess.
$theme[$plugin['theme']]['file'] = $plugin['file'];
}
}
}
return $theme;
}