Commit 97be8371 authored by Frank Bergmann's avatar Frank Bergmann

- OpenACS 5.9

parent 3b779760
<td>[<multiple name="opt">
<if @opt.current@ eq 1><strong>@opt.label@</strong></if><else><a href="@opt.href@">@opt.label@</a></else><if @opt:rowcount@ ne @opt.count@> | </if></multiple>]</td>
\ No newline at end of file
<table class="dimensional dimensional-table" border="0" cellspacing="0" cellpadding="3" width="100%">
<tr>
<multiple name="dimensional"><th>@dimensional.label@</th>
</multiple></tr>
<tr>
<multiple name="dimensional">
<include src="dimensional-table-option" &opt="opt_@dimensional.key;literal@" key="@dimensional.key;literal@" label="@dimensional.label;literal@">
</multiple>
</table>
\ No newline at end of file
<table class="dimensional dimensional-table" border="0" cellspacing="0" cellpadding="3" width="100%">
<tr><multiple name="dimensional"><th>@dimensional.label@</th><group column="key"></group>
</multiple></tr>
<tr><multiple name="dimensional">
<td>[<group column="key">
<if @dimensional.selected@ true><strong>@dimensional.group_label@</strong></if><else><a href="@dimensional.href@">@dimensional.group_label@</a></else><if @dimensional.groupnum_last_p@ false> | </if>
</group>]</td>
</multiple></tr>
</table>
This diff is collapsed.
<master>
<property name="&doc">doc</property>
<center>
<table border="0" cellpadding="8" cellspacing="0" width="80%">
<tr>
<tr><td valign="top" align="left">@LEFT;literal@</td>
<td valign="top" align="left">@RIGHT;literal@</td>
</tr>
</table>
</center>
<slave>
\ No newline at end of file
ad_library {
Definition of dimensional selection bar widget and helper functions.
@cvs-id $Id$
}
#
# Dimensional selection bars.
#
ad_proc ad_dimensional {
{-style ""}
option_list
{url {}}
{options_set ""}
{optionstype url}
} {
Generate an option bar from an option_list, which has the structure:
<pre>
{
{variable "Title" defaultvalue
{
{value "Label" {key sql-clause}}
...
}
}
...
}
</pre>
Here is an example of the option_list:
<pre>
set dimensional_list {
{visited "Last Visit" 1w {
{never "Never" {where "last_visit is null"}}
{1m "Last Month" {where "last_visit + 30 > sysdate"}}
{1w "Last Week" {where "last_visit + 7 > sysdate"}}
{1d "Today" {where "last_visit > trunc(sysdate)"}}
}}
..(more of the same)..
}
</pre>
@param style name of the adp file (without extension)
@param option_list the structure with the option data provided
@param url url target for select (if blank we set it to ad_conn url).
@param options_set if not provided defaults to [ns_getform], for hilite of selected options.
@param optionstype only url is used now, was thinking about extending
so we get radio buttons and a form since with a slow select updating one
thing at a time would be stupid.
@return HTML rendering
} {
if {$option_list eq ""} {
return
}
if {$options_set eq ""} {
set options_set [ns_getform]
}
if {$url eq ""} {
set url [ad_conn url]
}
if {$style eq ""} {
set style [parameter::get \
-package_id [ad_conn subsite_id] \
-parameter DefaultDimensionalStyle \
-default "dimensional"]
}
#
# Get the path. template::include needs a relative path.
#
set adp_stub [template::resource_path -type dimensionals -style $style -relative]
template::multirow create dimensional key label group_key group_label selected href
foreach option $option_list {
lassign $option option_key option_label option_default option_values
#
# Find out what the current option value is.
# check if a default is set otherwise the first value is used
#
set option_val {}
if { $options_set ne ""} {
set option_val [ns_set get $options_set $option_key]
}
if { $option_val eq "" } {
set option_val $option_default
}
foreach option_value $option_values {
lassign $option_value group_key group_label clause
set selected [expr {$option_val eq $group_key}]
set href $url?[export_ns_set_vars url $option_key $options_set]&[ns_urlencode $option_key]=[ns_urlencode $group_key]
template::multirow append dimensional $option_key $option_label $group_key $group_label $selected $href
}
}
#
# Finally, pass everything to the templating engine.
#
return [template::adp_include -uplevel 2 -- $adp_stub {&dimensional dimensional}]
}
ad_proc ad_dimensional_sql {
option_list
{what "where"}
{joiner "and"}
{options_set ""}
} {
Given what clause we are asking for and the joiner this returns
the sql fragment
@param option_list the structure with the option data provided
@param what look for such keys in the option_list
@param joiner join string for combining multiple clases
@param options_set ns_set for reading variables
@return SQL clause
@see ad_dimensional
} {
set out {}
if {$option_list eq ""} {
return
}
if {$options_set eq ""} {
set options_set [ns_getform]
}
foreach option $option_list {
# find out what the current option value is.
# check if a default is set otherwise the first value is used
set option_key [lindex $option 0]
set option_val {}
# get the option from the form
if { $options_set ne ""} {
set option_val [ns_set get $options_set $option_key]
}
#otherwise get from default
if { $option_val eq "" } {
set option_val [lindex $option 2]
}
foreach option_value [lindex $option 3] {
set thisoption [lindex $option_value 0]
if {$option_val eq $thisoption } {
set code [lindex $option_value 2]
if {$code ne ""} {
if {[lindex $code 0] eq $what } {
append out " $joiner [uplevel [list subst [lindex $code 1]]]"
}
}
}
}
}
return $out
}
#
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
body {
background-color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDDDDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5;
}
td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
pre {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.example1 {
font-weight: bold;
font-size: 14px
}
.example2 {
font-weight: bold;
font-size: 12px;
color: #FF0000
}
.tablerow1 {
background-color: #BBBBBB;
}
thead {
background-color: #FFBBBB;
}
tfoot {
background-color: #BBBBFF;
}
th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}
/* Basic formats */
.bold {
font-weight: bold;
}
.italic {
font-style: italic;
}
.underline {
text-decoration: underline;
}
/* Global align classes */
.left {
text-align: inherit;
}
.center {
text-align: center;
}
.right {
text-align: right;
}
.full {
text-align: justify
}
/* Image and table specific aligns */
img.left, table.left {
float: left;
text-align: inherit;
}
img.center, table.center {
margin-left: auto;
margin-right: auto;
text-align: inherit;
}
img.center {
display: block;
}
img.right, table.right {
float: right;
text-align: inherit;
}
body {
background-color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDDDDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5;
}
p {margin:0; padding:0;}
td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
pre {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.example1 {
font-weight: bold;
font-size: 14px
}
.example2 {
font-weight: bold;
font-size: 12px;
color: #FF0000
}
.tablerow1 {
background-color: #BBBBBB;
}
thead {
background-color: #FFBBBB;
}
tfoot {
background-color: #BBBBFF;
}
th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url"
// option is defined in TinyMCE init.
var tinyMCEImageList = new Array(
// Name, URL
["Logo 1", "media/logo.jpg"],
["Logo 2 Over", "media/logo_over.jpg"]
);
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There links will be displayed as a dropdown in all link dialogs if the "external_link_list_url"
// option is defined in TinyMCE init.
var tinyMCELinkList = new Array(
// Name, URL
["Moxiecode", "http://www.moxiecode.com"],
["Freshmeat", "http://www.freshmeat.com"],
["Sourceforge", "http://www.sourceforge.com"]
);
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There flash movies will be displayed as a dropdown in all media dialog if the "media_external_list_url"
// option is defined in TinyMCE init.
var tinyMCEMediaList = [
// Name, URL
["Some Flash", "media/sample.swf"],
["Some Quicktime", "media/sample.mov"],
["Some AVI", "media/sample.avi"]
];
\ No newline at end of file
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There templates will be displayed as a dropdown in all media dialog if the "template_external_list_url"
// option is defined in TinyMCE init.
var tinyMCETemplateList = [
// Name, URL, Description
["Simple snippet", "templates/snippet1.htm", "Simple HTML snippet."],
["Layout", "templates/layout1.htm", "HTML Layout."]
];
\ No newline at end of file
http://streaming.uga.edu/samples/ayp_lan.rm
\ No newline at end of file
(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square")},createControl:function(d,b){var f=this,e,h;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){h=f[d][0]}function c(i,k){var j=true;a(k.styles,function(m,l){if(f.editor.dom.getStyle(i,l)!=m){j=false;return false}});return j}function g(){var k,i=f.editor,l=i.dom,j=i.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,h)){i.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(h){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,h.styles);k.removeAttribute("_mce_style")}}}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){g()}});e.onRenderMenu.add(function(i,j){j.onShowMenu.add(function(){var m=f.editor.dom,l=m.getParent(f.editor.selection.getNode(),"ol,ul"),k;if(l||h){k=f[d];a(j.items,function(n){var o=true;n.setSelected(0);if(l&&!n.isDisabled()){a(k,function(p){if(p.id==n.id){if(!c(l,p)){o=false;return false}}});if(o){n.setSelected(1)}}});if(!l){j.items[h.id].setSelected(1)}}});j.add({id:f.editor.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle"}).setDisabled(1);a(f[d],function(k){k.id=f.editor.dom.uniqueId();j.add({id:k.id,title:k.title,onclick:function(){h=k;g()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
\ No newline at end of file
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
var each = tinymce.each;
tinymce.create('tinymce.plugins.AdvListPlugin', {
init : function(ed, url) {
var t = this;
t.editor = ed;
function buildFormats(str) {
var formats = [];
each(str.split(/,/), function(type) {
formats.push({
title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),
styles : {
listStyleType : type == 'default' ? '' : type
}
});
});
return formats;
};
// Setup number formats from config or default
t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");
t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");
},
createControl: function(name, cm) {
var t = this, btn, format;
if (name == 'numlist' || name == 'bullist') {
// Default to first item if it's a default item
if (t[name][0].title == 'advlist.def')
format = t[name][0];
function hasFormat(node, format) {
var state = true;
each(format.styles, function(value, name) {
// Format doesn't match
if (t.editor.dom.getStyle(node, name) != value) {
state = false;
return false;
}
});
return state;
};
function applyListFormat() {
var list, ed = t.editor, dom = ed.dom, sel = ed.selection;
// Check for existing list element
list = dom.getParent(sel.getNode(), 'ol,ul');
// Switch/add list type if needed
if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))
ed.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');
// Append styles to new list element
if (format) {
list = dom.getParent(sel.getNode(), 'ol,ul');
if (list) {
dom.setStyles(list, format.styles);
list.removeAttribute('_mce_style');
}
}
};
btn = cm.createSplitButton(name, {
title : 'advanced.' + name + '_desc',
'class' : 'mce_' + name,
onclick : function() {
applyListFormat();
}
});
btn.onRenderMenu.add(function(btn, menu) {
menu.onShowMenu.add(function() {
var dom = t.editor.dom, list = dom.getParent(t.editor.selection.getNode(), 'ol,ul'), fmtList;
if (list || format) {
fmtList = t[name];
// Unselect existing items
each(menu.items, function(item) {
var state = true;
item.setSelected(0);
if (list && !item.isDisabled()) {
each(fmtList, function(fmt) {
if (fmt.id == item.id) {
if (!hasFormat(list, fmt)) {
state = false;
return false;
}
}
});
if (state)
item.setSelected(1);
}
});
// Select the current format
if (!list)
menu.items[format.id].setSelected(1);
}
});
menu.add({id : t.editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
each(t[name], function(item) {
item.id = t.editor.dom.uniqueId();
menu.add({id : item.id, title : item.title, onclick : function() {
format = item;
applyListFormat();
}});
});
});
return btn;
}
},
getInfo : function() {
return {
longname : 'Advanced lists',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);
})();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment