first import
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<div class='context-editor clearfix'>
|
||||
<?php print drupal_render_children($form) ?>
|
||||
<div class='contexts'>
|
||||
<?php foreach (element_children($contexts) as $context): ?>
|
||||
<div class='context-editable' id='context-editable-<?php print $context ?>'><?php print drupal_render($contexts[$context]) ?></div>
|
||||
<?php endforeach; ?>
|
||||
<?php print drupal_render($contexts) ?>
|
||||
</div>
|
||||
<div class='buttons'><?php print drupal_render($buttons) ?></div>
|
||||
</div>
|
@@ -0,0 +1,2 @@
|
||||
<?php print drupal_render_children($form) ?>
|
||||
<div class='buttons'><?php print drupal_render($buttons) ?></div>
|
@@ -0,0 +1,22 @@
|
||||
<div class='context-plugins clearfix'>
|
||||
<div class='context-plugin-forms'>
|
||||
<?php foreach (element_children($form['plugins']) as $plugin): ?>
|
||||
<div class='context-plugin-form context-plugin-form-<?php print $plugin ?>'>
|
||||
<?php print drupal_render($form['plugins'][$plugin]) ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div class='context-plugin-selector'>
|
||||
<div class='context-plugin-info'>
|
||||
<h2 class='context-plugin-title'><?php print $title ?></h2>
|
||||
<div class='description'><?php print $description ?></div>
|
||||
<?php print drupal_render($form['selector']) ?>
|
||||
<?php print drupal_render($form['state']) ?>
|
||||
</div>
|
||||
<?php print theme('links', array('links' => $plugins, 'attributes' => array('class' => array('context-plugin-list')))) ?>
|
||||
</div>
|
||||
|
||||
<?php print drupal_render_children($form) ?>
|
||||
|
||||
</div>
|
66
sites/all/modules/context/context_ui/theme/filter.js
Normal file
66
sites/all/modules/context/context_ui/theme/filter.js
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* create a simple search filter thing for a list
|
||||
*/
|
||||
(function ($) {
|
||||
Drupal.Filter = function (list, title, type, parent){
|
||||
this.list = list;
|
||||
this.title = title;
|
||||
//provide defaults for type and parent so bad things don't happen
|
||||
if (!type) { var type = '*'; }
|
||||
this.type = type;
|
||||
if (!parent) { var parent = list; }
|
||||
this.parent = parent;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
Drupal.Filter.prototype = {
|
||||
init : function(){
|
||||
this.wrapper = $('<div class="filter-wrapper"></div>');
|
||||
if(this.title){
|
||||
this.title = '<h3>' + this.title + '</h3>';
|
||||
this.wrapper.append(this.title);
|
||||
}
|
||||
this.input = $('<input type="text" class="filter" />');
|
||||
this.wrapper.append(this.input);
|
||||
|
||||
$(this.parent).append(this.wrapper);
|
||||
this.createHandlers();
|
||||
},
|
||||
createHandlers : function(){
|
||||
var self = this;
|
||||
$(this.input).keyup(function(e){
|
||||
self.filter();
|
||||
});
|
||||
},
|
||||
filter : function(){
|
||||
//show all first off
|
||||
$('*', this.list).show();
|
||||
//hide ignored items
|
||||
if(this.input.val()) {
|
||||
$('*', this.list).not(this.type).hide();
|
||||
}
|
||||
|
||||
var regex = new RegExp(this.input.val(), 'i');
|
||||
|
||||
var self = this;
|
||||
$(this.type, this.list).each(function(ind, el) {
|
||||
var string = self.strip(el.innerHTML);
|
||||
if(!regex.test(string)){
|
||||
$(el).hide();
|
||||
} else { //show the parent and any labels or whatever in the parent
|
||||
var parent = $(el).parent().show();
|
||||
$('*', parent).not(self.type).show();
|
||||
}
|
||||
});
|
||||
},
|
||||
strip : function(string){
|
||||
var strip = /<([^<|^>]*)>/i;
|
||||
while(strip.test(string)){
|
||||
var matches = string.match(strip);
|
||||
string = string.replace(strip, '');
|
||||
}
|
||||
return string;
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
54
sites/all/modules/context/context_ui/theme/theme.inc
Normal file
54
sites/all/modules/context/context_ui/theme/theme.inc
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Preprocessor for theme('context_ui_editor').
|
||||
*/
|
||||
function template_preprocess_context_ui_editor(&$vars) {
|
||||
drupal_add_css(drupal_get_path('module', 'context_ui') . '/context_ui.css');
|
||||
drupal_add_js(drupal_get_path('module', 'context_ui') . '/context_ui.js');
|
||||
drupal_add_js(drupal_get_path('module', 'context_ui') . '/jquery.pageEditor.js');
|
||||
|
||||
$vars['contexts'] = $vars['form']['contexts'];
|
||||
unset($vars['form']['contexts']);
|
||||
|
||||
$vars['buttons'] = $vars['form']['buttons'];
|
||||
unset($vars['form']['buttons']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Preprocessor for theme('context_ui_plugins').
|
||||
*/
|
||||
function template_preprocess_context_ui_plugins(&$vars) {
|
||||
drupal_add_css(drupal_get_path("module", "context_ui") . "/context_ui.css");
|
||||
drupal_add_js(drupal_get_path("module", "context_ui") . "/context_ui.js");
|
||||
drupal_add_js(drupal_get_path('module', 'context_ui') . '/jquery.pageEditor.js');
|
||||
|
||||
// Provide title & desc.
|
||||
$vars['title'] = check_plain($vars['form']['#title']);
|
||||
$vars['description'] = check_plain($vars['form']['#description']);
|
||||
|
||||
// Build list of plugins.
|
||||
$plugins = array();
|
||||
$vars['plugins'] = array();
|
||||
foreach (element_children($vars['form']['plugins']) as $plugin) {
|
||||
$link = array(
|
||||
'title' => $vars['form']['plugins'][$plugin]['#plugin']->title . "<span class='remove'>" . t('Remove') . "</span>",
|
||||
'href' => $_GET['q'],
|
||||
'html' => TRUE,
|
||||
'fragment' => "context-plugin-form-{$plugin}",
|
||||
);
|
||||
$class = $vars['form']['plugins'][$plugin]['#context_enabled'] ? "context-plugin-{$plugin}" : "context-plugin-{$plugin} disabled";
|
||||
$vars['plugins'][$class] = $link;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Preprocessor for theme('context_ui_form').
|
||||
*/
|
||||
function template_preprocess_context_ui_form(&$vars) {
|
||||
drupal_add_css(drupal_get_path("module", "context_ui") . "/context_ui.css");
|
||||
drupal_add_js(drupal_get_path("module", "context_ui") . "/context_ui.js");
|
||||
drupal_add_js(drupal_get_path('module', 'context_ui') . '/jquery.pageEditor.js');
|
||||
$vars['buttons'] = $vars['form']['buttons'];
|
||||
unset($vars['form']['buttons']);
|
||||
}
|
Reference in New Issue
Block a user