openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 540675df113fd29a3a97625a3fcb656d396bb251
parent fd46c8b243efdc5a248c4160ef4f17072f7d59a6
Author: Jan Dankert <devnull@localhost>
Date:   Thu, 25 Oct 2012 20:36:30 +0200

Zusammenführen

Diffstat:
action/LanguagelistAction.class.php | 2+-
action/TemplateAction.class.php | 128-------------------------------------------------------------------------------
action/TemplatelistAction.class.php | 131+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
doc/examples/htaccess/url-example.htaccess | 16----------------
doc/examples/maintenance/make-theme-writeable.sh | 7-------
doc/examples/vhost-wrapper/index.php | 21---------------------
themes/default/images/icon/pub.png | 0
themes/default/images/icon_el_info.png | 0
themes/default/images/icon_el_infodate.png | 0
themes/default/images/icon_el_insert.png | 0
themes/default/images/icon_el_longtext.png | 0
themes/default/images/icon_el_select.png | 0
themes/default/images/icon_el_text.png | 0
themes/default/images/icon_file.png | 0
themes/default/images/icon_folder.png | 0
themes/default/images/icon_link.png | 0
themes/default/images/icon_page.png | 0
themes/default/layout/index.php | 2+-
themes/default/templates/grouplist/show.tpl.src.xml | 2+-
themes/default/templates/languagelist/show.tpl.src.xml | 2+-
themes/default/templates/projectlist/show.tpl.src.xml | 2+-
themes/default/templates/template/add.tpl.src.xml | 4----
themes/default/templates/templatelist/add.tpl.src.xml | 4++++
themes/default/templates/templatelist/show.tpl.src.xml | 19+++++++++----------
themes/default/templates/userlist/show.tpl.src.xml | 2+-
25 files changed, 150 insertions(+), 192 deletions(-)

diff --git a/action/LanguagelistAction.class.php b/action/LanguagelistAction.class.php @@ -1,4 +1,4 @@ -O<?php +<?php // --------------------------------------------------------------------------- // $Id$ // --------------------------------------------------------------------------- diff --git a/action/TemplateAction.class.php b/action/TemplateAction.class.php @@ -244,134 +244,6 @@ class TemplateAction extends Action } - /** - * Vorlage hinzuf�gen. - */ - function addView() - { - $this->setTemplateVar( 'templates',Template::getAll() ); - - $examples = array(); - $dir = opendir( 'examples/templates'); - while( $file = readdir($dir) ) - { - if ( substr($file,0,1) != '.') - { - $examples[$file] = $file; - } - } - - $this->setTemplateVar( 'examples',$examples ); - } - - - - function addPost() - { - // Hinzufuegen eines Templates - if ( $this->getRequestVar('name') == '' ) - { - $this->addValidationError('name'); - $this->callSubAction('add'); - return; - } - - // Hinzufuegen eines Templates - switch( $this->getRequestVar('type') ) - { - case 'empty': - - $template = new Template(); - $template->add( $this->getRequestVar('name') ); - $this->addNotice('template',$template->name,'ADDED','ok'); - break; - - case 'copy': - - $copy_templateid = intval($this->getRequestVar('templateid') ); - - if ( $copy_templateid == 0 ) - { - $this->addValidationError('templateid'); - $this->callSubAction('add'); - return; - } - - $template = new Template(); - $template->add( $this->getRequestVar('name') ); - $this->addNotice('template',$template->name,'ADDED','ok'); - - $copy_template = new Template( $copy_templateid ); - $copy_template->load(); - foreach( $copy_template->getElements() as $element ) - { - $element->load(); - $element->templateid = $template->templateid; - $element->add(); - $element->save(); - } - - $this->addNotice('template',$copy_template->name,'COPIED','ok'); - - break; - - case 'example': - - $template = new Template(); - - $model = Session::getProjectModel(); - $template->modelid = $model->modelid; - - $template->add( $this->getRequestVar('name') ); - - $example = parse_ini_file('examples/templates/'.$this->getRequestVar('example'),true); - - foreach( $example as $exampleKey=>$exampleElement ) - { - if ( !is_array($exampleElement) ) - { - $template->$exampleKey = $exampleElement; - } - else - { - $element = new Element(); - $element->templateid = $template->templateid; - $element->name = $exampleKey; - $element->writable = true; - $element->add(); - - foreach( $exampleElement as $ePropName=>$ePropValue) - $element->$ePropName = $ePropValue; - - $element->defaultText = str_replace(';',"\n",$element->defaultText); - $element->save(); -// Html::debug($element,"Element"); - } - } -// Html::debug($template,"Template"); - $template->name = $this->getRequestVar('name'); - $template->src = str_replace(';',"\n",$template->src); - - foreach( $template->getElementNames() as $elid=>$elname ) - { - $template->src = str_replace('{{'.$elname.'}}' ,'{{'.$elid.'}}' ,$template->src ); - $template->src = str_replace('{{->'.$elname.'}}','{{->'.$elid.'}}',$template->src ); - } - - $template->save(); - $this->addNotice('template',$template->name,'ADDED','ok'); - - break; - default: - $this->addValidationError('type'); - $this->callSubAction('add'); - return; - } - - - $this->setTemplateVar('tree_refresh',true); - } - function propView() { diff --git a/action/TemplatelistAction.class.php b/action/TemplatelistAction.class.php @@ -42,6 +42,7 @@ class TemplatelistAction extends Action } + // Anzeigen aller Templates // function showView() @@ -63,4 +64,134 @@ class TemplatelistAction extends Action } + + /** + * Vorlage hinzuf�gen. + */ + function addView() + { + $this->setTemplateVar( 'templates',Template::getAll() ); + + $examples = array(); + $dir = opendir( 'examples/templates'); + while( $file = readdir($dir) ) + { + if ( substr($file,0,1) != '.') + { + $examples[$file] = $file; + } + } + + $this->setTemplateVar( 'examples',$examples ); + } + + + + function addPost() + { + // Hinzufuegen eines Templates + if ( $this->getRequestVar('name') == '' ) + { + $this->addValidationError('name'); + $this->callSubAction('add'); + return; + } + + // Hinzufuegen eines Templates + switch( $this->getRequestVar('type') ) + { + case 'empty': + + $template = new Template(); + $template->add( $this->getRequestVar('name') ); + $this->addNotice('template',$template->name,'ADDED','ok'); + break; + + case 'copy': + + $copy_templateid = intval($this->getRequestVar('templateid') ); + + if ( $copy_templateid == 0 ) + { + $this->addValidationError('templateid'); + $this->callSubAction('add'); + return; + } + + $template = new Template(); + $template->add( $this->getRequestVar('name') ); + $this->addNotice('template',$template->name,'ADDED','ok'); + + $copy_template = new Template( $copy_templateid ); + $copy_template->load(); + foreach( $copy_template->getElements() as $element ) + { + $element->load(); + $element->templateid = $template->templateid; + $element->add(); + $element->save(); + } + + $this->addNotice('template',$copy_template->name,'COPIED','ok'); + + break; + + case 'example': + + $template = new Template(); + + $model = Session::getProjectModel(); + $template->modelid = $model->modelid; + + $template->add( $this->getRequestVar('name') ); + + $example = parse_ini_file('examples/templates/'.$this->getRequestVar('example'),true); + + foreach( $example as $exampleKey=>$exampleElement ) + { + if ( !is_array($exampleElement) ) + { + $template->$exampleKey = $exampleElement; + } + else + { + $element = new Element(); + $element->templateid = $template->templateid; + $element->name = $exampleKey; + $element->writable = true; + $element->add(); + + foreach( $exampleElement as $ePropName=>$ePropValue) + $element->$ePropName = $ePropValue; + + $element->defaultText = str_replace(';',"\n",$element->defaultText); + $element->save(); +// Html::debug($element,"Element"); + } + } +// Html::debug($template,"Template"); + $template->name = $this->getRequestVar('name'); + $template->src = str_replace(';',"\n",$template->src); + + foreach( $template->getElementNames() as $elid=>$elname ) + { + $template->src = str_replace('{{'.$elname.'}}' ,'{{'.$elid.'}}' ,$template->src ); + $template->src = str_replace('{{->'.$elname.'}}','{{->'.$elid.'}}',$template->src ); + } + + $template->save(); + $this->addNotice('template',$template->name,'ADDED','ok'); + + break; + default: + $this->addValidationError('type'); + $this->callSubAction('add'); + return; + } + + + $this->setTemplateVar('tree_refresh',true); + } + + } \ No newline at end of file diff --git a/doc/examples/htaccess/url-example.htaccess b/doc/examples/htaccess/url-example.htaccess @@ -1,16 +0,0 @@ -# $Id$ - -# For security (or coolness) reasons you are able to fake the url and -# hide that you are using PHP. Hmm. -# There is no real reason to use this, but if you want play... just play. - -RewriteEngine on -RewriteRule ([a-z]+)\,([a-z]*)\,?(\-?[0-9]*).do$ /openrat/do.php?action=$1&subaction=$2&id=$3&%{QUERY_STRING} - -# ATTENTION, this must be synchronized with your configuration. -# The above example needs a setting in 'interface.ini.php': -# ... -# [url] -# ... -# url_format= "%s,%s,%d.do" -# ... diff --git a/doc/examples/maintenance/make-theme-writeable.sh b/doc/examples/maintenance/make-theme-writeable.sh @@ -1,6 +0,0 @@ -#!/bin/bash -if [ ! -d themes/default/pages ]; then - echo "not an openrat directory. please execute this script in openrat program directory" - exit 4 -fi -find themes/default/pages |xargs chmod -v a+w- \ No newline at end of file diff --git a/doc/examples/vhost-wrapper/index.php b/doc/examples/vhost-wrapper/index.php @@ -1,20 +0,0 @@ -<?php - - -// URL of the base installation -define('OR_BASE_URL' ,'/openrat' ); - -// base installation directory -define('OR_INSTALLATION_PATH','/home/dankert/privat/public_html/cms-test/cms/'); - -// your config dir -define('OR_CONFIG','config'); - - -// do not change below here. -define('OR_EXT_CONTROLLER_FILE',basename(getenv('SCRIPT_FILENAME'))); -define('OR_EXT_CONFIG_DIR',dirname(getenv('SCRIPT_FILENAME')).'/'.OR_CONFIG.'/'); -chdir(OR_INSTALLATION_PATH); -require('do.php'); - -?>- \ No newline at end of file diff --git a/themes/default/images/icon/pub.png b/themes/default/images/icon/pub.png Binary files differ. diff --git a/themes/default/images/icon_el_info.png b/themes/default/images/icon_el_info.png Binary files differ. diff --git a/themes/default/images/icon_el_infodate.png b/themes/default/images/icon_el_infodate.png Binary files differ. diff --git a/themes/default/images/icon_el_insert.png b/themes/default/images/icon_el_insert.png Binary files differ. diff --git a/themes/default/images/icon_el_longtext.png b/themes/default/images/icon_el_longtext.png Binary files differ. diff --git a/themes/default/images/icon_el_select.png b/themes/default/images/icon_el_select.png Binary files differ. diff --git a/themes/default/images/icon_el_text.png b/themes/default/images/icon_el_text.png Binary files differ. diff --git a/themes/default/images/icon_file.png b/themes/default/images/icon_file.png Binary files differ. diff --git a/themes/default/images/icon_folder.png b/themes/default/images/icon_folder.png Binary files differ. diff --git a/themes/default/images/icon_link.png b/themes/default/images/icon_link.png Binary files differ. diff --git a/themes/default/images/icon_page.png b/themes/default/images/icon_page.png Binary files differ. diff --git a/themes/default/layout/index.php b/themes/default/layout/index.php @@ -23,7 +23,7 @@ ?> <link rel="<?php echo $meta['name'] ?>" href="<?php echo $meta['url'] ?>" title="<?php echo $meta['title'] ?>" ><?php } ?> - <link id="userstyle" rel="stylesheet" type="text/css" href="<?php /* erzeuge $conf: */ require( 'config/config-default.php'); echo css_link() ?>" > + <link id="userstyle" rel="stylesheet" type="text/css" href="<?php echo css_link() ?>" > <link rel="stylesheet" type="text/css" href="<?php echo OR_THEMES_EXT_DIR ?>../editor/markitup/markitup/skins/markitup/style.css" /> <link rel="stylesheet" type="text/css" href="<?php echo OR_THEMES_EXT_DIR ?>../editor/markitup/markitup/sets/default/style.css" /> diff --git a/themes/default/templates/grouplist/show.tpl.src.xml b/themes/default/templates/grouplist/show.tpl.src.xml @@ -15,7 +15,7 @@ </row> </list> <row class="data"> - <column colspan="2"> + <column colspan="2" class="clickable"> <link type="view" subaction="add"> <image icon="add"/> <text text="new"/> diff --git a/themes/default/templates/languagelist/show.tpl.src.xml b/themes/default/templates/languagelist/show.tpl.src.xml @@ -53,7 +53,7 @@ <set var="default_url"></set> </list> <row class="data"> - <column colspan="4"> + <column colspan="4" class="clickable"> <link type="view" subaction="add"> <image icon="add"/> <text text="new"/> diff --git a/themes/default/templates/projectlist/show.tpl.src.xml b/themes/default/templates/projectlist/show.tpl.src.xml @@ -17,7 +17,7 @@ </row> </list> <row class="data"> - <column> + <column class="clickable"> <link type="view" subaction="add"> <image icon="add" /> <text text="new" /> diff --git a/themes/default/templates/template/add.tpl.src.xml b/themes/default/templates/template/add.tpl.src.xml @@ -1,3 +0,0 @@ -<output xmlns="http://www.openrat.de/template" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.openrat.de/template ../template.xsd"><dummy><form><window name="GLOBAL_TEMPLATES" widths="10px,40px"><row><column colspan="2"><text text="message:name"></text></column><column><input name="name"></input></column></row><row><column colspan="3"><group title="message:options"></group></column></row><row><column><radio name="type" value="empty"></radio></column><column><label for="type_empty"><text key="empty"></text></label></column></row><row><column><radio name="type" value="copy"></radio></column><column><label for="type_copy"><text key="copy"></text></label></column><column><selectbox name="templateid" list="templates"></selectbox></column></row><row><column><radio name="type" value="example"></radio></column><column><label for="type_example"><text key="example"></text></label></column><column><selectbox name="example" list="examples"></selectbox></column></row><row><column colspan="3" class="act"><button type="ok"></button></column></row></window></form><focus field="name"></focus></dummy></output>- \ No newline at end of file diff --git a/themes/default/templates/templatelist/add.tpl.src.xml b/themes/default/templates/templatelist/add.tpl.src.xml @@ -0,0 +1,3 @@ +<output xmlns="http://www.openrat.de/template" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openrat.de/template ../template.xsd"><dummy><form><window name="GLOBAL_TEMPLATES" widths="10px,40px"><row><column colspan="2"><text text="message:name"></text></column><column><input name="name"></input></column></row><row><column colspan="3"><group title="message:options"></group></column></row><row><column><radio name="type" value="empty"></radio></column><column><label for="type_empty"><text key="empty"></text></label></column></row><row><column><radio name="type" value="copy"></radio></column><column><label for="type_copy"><text key="copy"></text></label></column><column><selectbox name="templateid" list="templates"></selectbox></column></row><row><column><radio name="type" value="example"></radio></column><column><label for="type_example"><text key="example"></text></label></column><column><selectbox name="example" list="examples"></selectbox></column></row><row><column colspan="3" class="act"><button type="ok"></button></column></row></window></form><focus field="name"></focus></dummy></output>+ \ No newline at end of file diff --git a/themes/default/templates/templatelist/show.tpl.src.xml b/themes/default/templates/templatelist/show.tpl.src.xml @@ -13,20 +13,19 @@ </column> </row> </list> - + <if empty="templates"> + <row> + <text text="GLOBAL_NO_TEMPLATES_AVAILABLE_DESC"></text> + </row> + </if> + <row class="data"> - <column colspan="1"> + <column colspan="1" class="clickable"> <link type="view" subaction="add"> - <image icon="add"/> - <text text="new"/> + <image icon="add" /> + <text text="new" /> </link> </column> </row> </table> - <if empty="templates"> - <text text="GLOBAL_NO_TEMPLATES_AVAILABLE_DESC"></text> - </if> - <link class="action" action="template" subaction="add"> - <text key="menu_template_add"></text> - </link> </output> \ No newline at end of file diff --git a/themes/default/templates/userlist/show.tpl.src.xml b/themes/default/templates/userlist/show.tpl.src.xml @@ -35,7 +35,7 @@ </row> </list> <row class="data"> - <column colspan="3"> + <column colspan="3" class="clickable"> <link type="view" subaction="add"> <image icon="add"/> <text text="new"/>