diff options
42 files changed, 2441 insertions, 3 deletions
diff --git a/assets/1f02b218/pager.css b/assets/1f02b218/pager.css new file mode 100644 index 0000000..1c802cc --- /dev/null +++ b/assets/1f02b218/pager.css @@ -0,0 +1,67 @@ +/** + * CSS styles for CLinkPager. + * + * @author Qiang Xue <qiang.xue@gmail.com> + * @link http://www.yiiframework.com/ + * @copyright Copyright © 2008-2010 Yii Software LLC + * @license http://www.yiiframework.com/license/ + * @version $Id: pager.css 1678 2010-01-07 21:02:00Z qiang.xue $ + * @since 1.0 + */ + +ul.yiiPager +{ + font-size:11px; + border:0; + margin:0; + padding:0; + line-height:100%; + display:inline; +} + +ul.yiiPager li +{ + display:inline; +} + +ul.yiiPager a:link, +ul.yiiPager a:visited +{ + border:solid 1px #9aafe5; + font-weight:bold; + color:#0e509e; + padding:1px 6px; + text-decoration:none; +} + +ul.yiiPager .page a +{ + font-weight:normal; +} + +ul.yiiPager a:hover +{ + border:solid 1px #0e509e; +} + +ul.yiiPager .selected a +{ + background:#2e6ab1; + color:#FFFFFF; + font-weight:bold; +} + +ul.yiiPager .hidden a +{ + border:solid 1px #DEDEDE; + color:#888888; +} + +/** + * Hide first and last buttons by default. + */ +ul.yiiPager .first, +ul.yiiPager .last +{ + display:none; +}
\ No newline at end of file diff --git a/assets/bd4d787c/editor.js b/assets/bd4d787c/editor.js new file mode 100644 index 0000000..7317d3b --- /dev/null +++ b/assets/bd4d787c/editor.js @@ -0,0 +1,140 @@ +/** + * Some browser detection + */ +var clientPC = navigator.userAgent.toLowerCase(); // Get client info +var is_gecko = ((clientPC.indexOf('gecko')!=-1) && (clientPC.indexOf('spoofer')==-1) + && (clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0')==-1)); +var is_safari = ((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1)); +var is_khtml = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled )); +if (clientPC.indexOf('opera')!=-1) { + var is_opera = true; + var is_opera_preseven = (window.opera && !document.childNodes); + var is_opera_seven = (window.opera && document.childNodes); +} + +//{{{ insertTags +/** + * apply tagOpen/tagClose to selection in textarea, use sampleText instead + * of selection if there is none copied and adapted from phpBB + * + * @author phpBB development team + * @author MediaWiki development team + * @author Andreas Gohr <andi@splitbrain.org> + * @author Jim Raynor <jim_raynor@web.de> + */ +function insertTags(elID, tagOpen, tagClose, sampleText) { + tagOpen = tagOpen.replace(/bslashN/g,'\n'); + tagClose = tagClose.replace(/bslashN/g,'\n'); + var txtarea = document.getElementById(elID); + // IE + if(document.selection && !is_gecko) { + var theSelection = document.selection.createRange().text; + var replaced = true; + if(!theSelection){ + replaced = false; + theSelection=sampleText; + } + txtarea.focus(); + + // This has change + text = theSelection; + if(theSelection.charAt(theSelection.length - 1) == " "){// exclude ending space char, if any + theSelection = theSelection.substring(0, theSelection.length - 1); + r = document.selection.createRange(); + r.text = tagOpen + theSelection + tagClose + " "; + } else { + r = document.selection.createRange(); + r.text = tagOpen + theSelection + tagClose; + } + if(!replaced){ + r.moveStart('character',-text.length-tagClose.length); + r.moveEnd('character',-tagClose.length); + } + r.select(); + // Mozilla + } else if(txtarea.selectionStart || txtarea.selectionStart == '0') { + var replaced = false; + var startPos = txtarea.selectionStart; + var endPos = txtarea.selectionEnd; + if(endPos - startPos) replaced = true; + var scrollTop=txtarea.scrollTop; + var myText = (txtarea.value).substring(startPos, endPos); + if(!myText) { myText=sampleText;} + if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any + subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; + } else { + subst = tagOpen + myText + tagClose; + } + txtarea.value = txtarea.value.substring(0, startPos) + subst + + txtarea.value.substring(endPos, txtarea.value.length); + txtarea.focus(); + + //set new selection + if(replaced){ + var cPos=startPos+(tagOpen.length+myText.length+tagClose.length); + txtarea.selectionStart=cPos; + txtarea.selectionEnd=cPos; + }else{ + txtarea.selectionStart=startPos+tagOpen.length; + txtarea.selectionEnd=startPos+tagOpen.length+myText.length; + } + txtarea.scrollTop=scrollTop; + // All others + } else { + var copy_alertText=alertText; + var re1=new RegExp("\\$1","g"); + var re2=new RegExp("\\$2","g"); + copy_alertText=copy_alertText.replace(re1,sampleText); + copy_alertText=copy_alertText.replace(re2,tagOpen+sampleText+tagClose); + var text; + if (sampleText) { + text=prompt(copy_alertText); + } else { + text=""; + } + if(!text) { text=sampleText;} + text=tagOpen+text+tagClose; + //append to the end + txtarea.value += "\n"+text; + + // in Safari this causes scrolling + if(!is_safari) { + txtarea.focus(); + } + + } + // reposition cursor if possible + if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate(); + + return false; +} +// }}} + +// {{{ moreRows +/** + * Adds 2 more rows to a textarea + */ +function moreRows(textareaId) +{ + document.getElementById(textareaId).rows = document.getElementById(textareaId).rows + 2; +} // }}} + +// {{{ lessRows +/** + * Reduces a textarea by 2 rows + */ +function lessRows(textareaId) +{ + if( document.getElementById(textareaId).rows>2 ) + document.getElementById(textareaId).rows = document.getElementById(textareaId).rows - 2; +}// }}} + +// {{{ padText +function padText(text, length) +{ + var result=""; + for(i=0; i<length; i++) + result = result + text; + return result; +} +// }}} diff --git a/assets/bd4d787c/styles.css b/assets/bd4d787c/styles.css new file mode 100644 index 0000000..0568bd3 --- /dev/null +++ b/assets/bd4d787c/styles.css @@ -0,0 +1,15 @@ +.ddeditor .preview +{ + display: none; + border: 1px solid #aaa; + padding: 3px; +} +.ddeditor BUTTON,SELECT +{ + font-size: 9pt; +} +.ddeditor BUTTON +{ + border: 1px solid blue; + background-color: #eee; +} diff --git a/assets/e96affe6/detailview/styles.css b/assets/e96affe6/detailview/styles.css new file mode 100644 index 0000000..bc5f6d2 --- /dev/null +++ b/assets/e96affe6/detailview/styles.css @@ -0,0 +1,44 @@ +table.detail-view .null +{ + color: pink; +} + +table.detail-view +{ + background: white; + border-collapse: collapse; + width: 100%; + margin: 0; +} + +table.detail-view th, table.detail-view td +{ + font-size: 0.9em; + border: 1px white solid; + padding: 0.3em 0.6em; + vertical-align: top; +} + +table.detail-view th +{ + text-align: right; + width: 160px; +} + +table.detail-view tr.odd +{ + background:#E5F1F4; +} + +table.detail-view tr.even +{ + background:#F8F8F8; +} + +table.detail-view tr.odd th +{ +} + +table.detail-view tr.even th +{ +} diff --git a/assets/e96affe6/gridview/bg.gif b/assets/e96affe6/gridview/bg.gif Binary files differnew file mode 100644 index 0000000..4283989 --- /dev/null +++ b/assets/e96affe6/gridview/bg.gif diff --git a/assets/e96affe6/gridview/delete.png b/assets/e96affe6/gridview/delete.png Binary files differnew file mode 100644 index 0000000..dc4c12a --- /dev/null +++ b/assets/e96affe6/gridview/delete.png diff --git a/assets/e96affe6/gridview/down.gif b/assets/e96affe6/gridview/down.gif Binary files differnew file mode 100644 index 0000000..a4933b8 --- /dev/null +++ b/assets/e96affe6/gridview/down.gif diff --git a/assets/e96affe6/gridview/jquery.yiigridview.js b/assets/e96affe6/gridview/jquery.yiigridview.js new file mode 100644 index 0000000..700f247 --- /dev/null +++ b/assets/e96affe6/gridview/jquery.yiigridview.js @@ -0,0 +1,413 @@ +/** + * jQuery Yii GridView plugin file. + * + * @author Qiang Xue <qiang.xue@gmail.com> + * @link http://www.yiiframework.com/ + * @copyright Copyright © 2008-2010 Yii Software LLC + * @license http://www.yiiframework.com/license/ + * @version $Id: jquery.yiigridview.js 3486 2011-12-16 00:25:01Z mdomba $ + */ + +(function ($) { + var selectCheckedRows, methods, + gridSettings = []; + + /** + * 1. Selects rows that have checkbox checked (only checkbox that is connected with selecting a row) + * 2. Check if "check all" need to be checked/unchecked + * @return object the jQuery object + */ + selectCheckedRows = function (gridId) { + var settings = gridSettings[gridId], + table = $('#' + gridId).children('.' + settings.tableClass); + + table.children('tbody').find('input.select-on-check').filter(':checked').each(function () { + $(this).closest('tr').addClass('selected'); + }); + + table.children('thead').find('th input').filter('[type="checkbox"]').each(function () { + var name = this.name.substring(0, this.name.length - 4) + '[]', //.. remove '_all' and add '[]'' + $checks = $("input[name='" + name + "']", table); + this.checked = $checks.length > 0 && $checks.length === $checks.filter(':checked').length; + }); + return this; + }; + + methods = { + /** + * yiiGridView set function. + * @param options map settings for the grid view. Available options are as follows: + * - ajaxUpdate: array, IDs of the containers whose content may be updated by ajax response + * - ajaxVar: string, the name of the GET variable indicating the ID of the element triggering the AJAX request + * - pagerClass: string, the CSS class for the pager container + * - tableClass: string, the CSS class for the table + * - selectableRows: integer, the number of rows that can be selected + * - updateSelector: string, the selector for choosing which elements can trigger ajax requests + * - beforeAjaxUpdate: function, the function to be called before ajax request is sent + * - afterAjaxUpdate: function, the function to be called after ajax response is received + * - ajaxUpdateError: function, the function to be called if an ajax error occurs + * - selectionChanged: function, the function to be called after the row selection is changed + * @return object the jQuery object + */ + init: function (options) { + var settings = $.extend({ + ajaxUpdate: [], + ajaxVar: 'ajax', + pagerClass: 'pager', + loadingClass: 'loading', + filterClass: 'filters', + tableClass: 'items', + selectableRows: 1 + // updateSelector: '#id .pager a, '#id .grid thead th a', + // beforeAjaxUpdate: function (id) {}, + // afterAjaxUpdate: function (id, data) {}, + // selectionChanged: function (id) {}, + // url: 'ajax request URL' + }, options || {}); + + return this.each(function () { + var $grid = $(this), + id = $grid.attr('id'), + inputSelector = '#' + id + ' .' + settings.filterClass + ' input, ' + '#' + id + ' .' + settings.filterClass + ' select'; + + settings.tableClass = settings.tableClass.replace(/\s+/g, '.'); + if (settings.updateSelector === undefined) { + settings.updateSelector = '#' + id + ' .' + settings.pagerClass.replace(/\s+/g, '.') + ' a, #' + id + ' .' + settings.tableClass + ' thead th a'; + } + + gridSettings[id] = settings; + + if (settings.ajaxUpdate.length > 0) { + $(document).on('click', settings.updateSelector, function () { + $('#' + id).yiiGridView('update', {url: $(this).attr('href')}); + return false; + }); + } + + $(document).on('change', inputSelector, function () { + var data = $(inputSelector).serialize(); + if (settings.pageVar !== undefined) { + data += '&' + settings.pageVar + '=1'; + } + $('#' + id).yiiGridView('update', {data: data}); + }); + + if (settings.selectableRows > 0) { + selectCheckedRows(this.id); + $(document).on('click', '#' + id + ' .' + settings.tableClass + ' > tbody > tr', function (e) { + var $currentGrid, $row, isRowSelected, $checks, + $target = $(e.target); + + if ($target.closest('td').hasClass('button-column') || (e.target.type === 'checkbox' && !$target.hasClass('select-on-check'))) { + return; + } + + $row = $(this); + $currentGrid = $('#' + id); + $checks = $('input.select-on-check', $currentGrid); + isRowSelected = $row.toggleClass('selected').hasClass('selected'); + + if (settings.selectableRows === 1) { + $row.siblings().removeClass('selected'); + $checks.prop('checked', false); + } + $('input.select-on-check', $row).prop('checked', isRowSelected); + $("input.select-on-check-all", $currentGrid).prop('checked', $checks.length === $checks.filter(':checked').length); + + if (settings.selectionChanged !== undefined) { + settings.selectionChanged(id); + } + }); + if (settings.selectableRows > 1) { + $(document).on('click', '#' + id + ' .select-on-check-all', function () { + var $currentGrid = $('#' + id), + $checks = $('input.select-on-check', $currentGrid), + $checksAll = $('input.select-on-check-all', $currentGrid), + $rows = $currentGrid.children('.' + settings.tableClass).children('tbody').children(); + if (this.checked) { + $rows.addClass('selected'); + $checks.prop('checked', true); + $checksAll.prop('checked', true); + } else { + $rows.removeClass('selected'); + $checks.prop('checked', false); + $checksAll.prop('checked', false); + } + if (settings.selectionChanged !== undefined) { + settings.selectionChanged(id); + } + }); + } + } else { + $(document).on('click', '#' + id + ' .select-on-check', false); + } + }); + }, + + /** + * Returns the key value for the specified row + * @param row integer the row number (zero-based index) + * @return string the key value + */ + getKey: function (row) { + return this.children('.keys').children('span').eq(row).text(); + }, + + /** + * Returns the URL that generates the grid view content. + * @return string the URL that generates the grid view content. + */ + getUrl: function () { + var sUrl = gridSettings[this.attr('id')].url; + return sUrl || this.children('.keys').attr('title'); + }, + + /** + * Returns the jQuery collection of the cells in the specified row. + * @param row integer the row number (zero-based index) + * @return jQuery the jQuery collection of the cells in the specified row. + */ + getRow: function (row) { + var sClass = gridSettings[this.attr('id')].tableClass; + return this.children('.' + sClass).children('tbody').children('tr').eq(row).children(); + }, + + /** + * Returns the jQuery collection of the cells in the specified column. + * @param column integer the column number (zero-based index) + * @return jQuery the jQuery collection of the cells in the specified column. + */ + getColumn: function (column) { + var sClass = gridSettings[this.attr('id')].tableClass; + return this.children('.' + sClass).children('tbody').children('tr').children('td:nth-child(' + (column + 1) + ')'); + }, + + /** + * Performs an AJAX-based update of the grid view contents. + * @param options map the AJAX request options (see jQuery.ajax API manual). By default, + * the URL to be requested is the one that generates the current content of the grid view. + * @return object the jQuery object + */ + update: function (options) { + var customError; + if (options && options.error !== undefined) { + customError = options.error; + delete options.error; + } + + return this.each(function () { + var $form, + $grid = $(this), + id = $grid.attr('id'), + settings = gridSettings[id]; + $grid.addClass(settings.loadingClass); + + options = $.extend({ + type: 'GET', + url: $grid.yiiGridView('getUrl'), + success: function (data) { + var $data = $('<div>' + data + '</div>'); + $grid.removeClass(settings.loadingClass); + $.each(settings.ajaxUpdate, function (i, el) { + var updateId = '#' + el; + $(updateId).replaceWith($(updateId, $data)); + }); + if (settings.afterAjaxUpdate !== undefined) { + settings.afterAjaxUpdate(id, data); + } + if (settings.selectableRows > 0) { + selectCheckedRows(id); + } + }, + error: function (XHR, textStatus, errorThrown) { + var ret, err; + $grid.removeClass(settings.loadingClass); + if (XHR.readyState === 0 || XHR.status === 0) { + return; + } + if (customError !== undefined) { + ret = customError(XHR); + if (ret !== undefined && !ret) { + return; + } + } + switch (textStatus) { + case 'timeout': + err = 'The request timed out!'; + break; + case 'parsererror': + err = 'Parser error!'; + break; + case 'error': + if (XHR.status && !/^\s*$/.test(XHR.status)) { + err = 'Error ' + XHR.status; + } else { + err = 'Error'; + } + if (XHR.responseText && !/^\s*$/.test(XHR.responseText)) { + err = err + ': ' + XHR.responseText; + } + break; + } + + if (settings.ajaxUpdateError !== undefined) { + settings.ajaxUpdateError(XHR, textStatus, errorThrown, err); + } else if (err) { + alert(err); + } + } + }, options || {}); + if (options.data !== undefined && options.type === 'GET') { + options.url = $.param.querystring(options.url, options.data); + options.data = {}; + } + + if (settings.ajaxUpdate !== false) { + options.url = $.param.querystring(options.url, settings.ajaxVar + '=' + id); + if (settings.beforeAjaxUpdate !== undefined) { + settings.beforeAjaxUpdate(id, options); + } + $.ajax(options); + } else { // non-ajax mode + if (options.type === 'GET') { + window.location.href = options.url; + } else { // POST mode + $form = $('<form action="' + options.url + '" method="post"></form>').appendTo('body'); + if (options.data === undefined) { + options.data = {}; + } + + if (options.data.returnUrl === undefined) { + options.data.returnUrl = window.location.href; + } + + $.each(options.data, function (name, value) { + $form.append($('<input type="hidden" name="t" value="" />').attr('name', name).val(value)); + }); + $form.submit(); + } + } + }); + }, + + /** + * Returns the key values of the currently selected rows. + * @return array the key values of the currently selected rows. + */ + getSelection: function () { + var settings = gridSettings[this.attr('id')], + keys = this.find('.keys span'), + selection = []; + this.children('.' + settings.tableClass).children('tbody').children().each(function (i) { + if ($(this).hasClass('selected')) { + selection.push(keys.eq(i).text()); + } + }); + return selection; + }, + + /** + * Returns the key values of the currently checked rows. + * @param column_id string the ID of the column + * @return array the key values of the currently checked rows. + */ + getChecked: function (column_id) { + var settings = gridSettings[this.attr('id')], + keys = this.find('.keys span'), + checked = []; + if (column_id.substring(column_id.length - 2) !== '[]') { + column_id = column_id + '[]'; + } + this.children('.' + settings.tableClass).children('tbody').children('tr').children('td').children('input[name="' + column_id + '"]').each(function (i) { + if (this.checked) { + checked.push(keys.eq(i).text()); + } + }); + return checked; + } + }; + + $.fn.yiiGridView = function (method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if (typeof method === 'object' || !method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.yiiGridView'); + return false; + } + }; + +/****************************************************************************** + *** DEPRECATED METHODS + *** used before Yii 1.1.9 + ******************************************************************************/ + $.fn.yiiGridView.settings = gridSettings; + /** + * Returns the key value for the specified row + * @param id string the ID of the grid view container + * @param row integer the row number (zero-based index) + * @return string the key value + */ + $.fn.yiiGridView.getKey = function (id, row) { + return $('#' + id).yiiGridView('getKey', row); + }; + + /** + * Returns the URL that generates the grid view content. + * @param id string the ID of the grid view container + * @return string the URL that generates the grid view content. + */ + $.fn.yiiGridView.getUrl = function (id) { + return $('#' + id).yiiGridView('getUrl'); + }; + + /** + * Returns the jQuery collection of the cells in the specified row. + * @param id string the ID of the grid view container + * @param row integer the row number (zero-based index) + * @return jQuery the jQuery collection of the cells in the specified row. + */ + $.fn.yiiGridView.getRow = function (id, row) { + return $('#' + id).yiiGridView('getRow', row); + }; + + /** + * Returns the jQuery collection of the cells in the specified column. + * @param id string the ID of the grid view container + * @param column integer the column number (zero-based index) + * @return jQuery the jQuery collection of the cells in the specified column. + */ + $.fn.yiiGridView.getColumn = function (id, column) { + return $('#' + id).yiiGridView('getColumn', column); + }; + + /** + * Performs an AJAX-based update of the grid view contents. + * @param id string the ID of the grid view container + * @param options map the AJAX request options (see jQuery.ajax API manual). By default, + * the URL to be requested is the one that generates the current content of the grid view. + */ + $.fn.yiiGridView.update = function (id, options) { + $('#' + id).yiiGridView('update', options); + }; + + /** + * Returns the key values of the currently selected rows. + * @param id string the ID of the grid view container + * @return array the key values of the currently selected rows. + */ + $.fn.yiiGridView.getSelection = function (id) { + return $('#' + id).yiiGridView('getSelection'); + }; + + /** + * Returns the key values of the currently checked rows. + * @param id string the ID of the grid view container + * @param column_id string the ID of the column + * @return array the key values of the currently checked rows. + */ + $.fn.yiiGridView.getChecked = function (id, column_id) { + return $('#' + id).yiiGridView('getChecked', column_id); + }; +})(jQuery);
\ No newline at end of file diff --git a/assets/e96affe6/gridview/loading.gif b/assets/e96affe6/gridview/loading.gif Binary files differnew file mode 100644 index 0000000..5b33f7e --- /dev/null +++ b/assets/e96affe6/gridview/loading.gif diff --git a/assets/e96affe6/gridview/styles.css b/assets/e96affe6/gridview/styles.css new file mode 100644 index 0000000..d304d49 --- /dev/null +++ b/assets/e96affe6/gridview/styles.css @@ -0,0 +1,120 @@ +.grid-view-loading +{ + background:url(loading.gif) no-repeat; +} + +.grid-view +{ + padding: 15px 0; +} + +.grid-view table.items +{ + background: white; + border-collapse: collapse; + width: 100%; + border: 1px #D0E3EF solid; +} + +.grid-view table.items th, .grid-view table.items td +{ + font-size: 0.9em; + border: 1px white solid; + padding: 0.3em; +} + +.grid-view table.items th +{ + color: white; + background: url("bg.gif") repeat-x scroll left top white; + text-align: center; +} + +.grid-view table.items th a +{ + color: #EEE; + font-weight: bold; + text-decoration: none; +} + +.grid-view table.items th a:hover +{ + color: #FFF; +} + +.grid-view table.items th a.asc +{ + background:url(up.gif) right center no-repeat; + padding-right: 10px; +} + +.grid-view table.items th a.desc +{ + background:url(down.gif) right center no-repeat; + padding-right: 10px; +} + +.grid-view table.items tr.even +{ + background: #F8F8F8; +} + +.grid-view table.items tr.odd +{ + background: #E5F1F4; +} + +.grid-view table.items tr.selected +{ + background: #BCE774; +} + +.grid-view table.items tr:hover +{ + background: #ECFBD4; +} + +.grid-view .link-column img +{ + border: 0; +} + +.grid-view .button-column +{ + text-align: center; + width: 60px; +} + +.grid-view .button-column img +{ + border: 0; +} + +.grid-view .checkbox-column +{ + width: 15px; +} + +.grid-view .summary +{ + margin: 0 0 5px 0; + text-align: right; +} + +.grid-view .pager +{ + margin: 5px 0 0 0; + text-align: right; +} + +.grid-view .empty +{ + font-style: italic; +} + +.grid-view .filters input, +.grid-view .filters select +{ + width: 100%; + border: 1px solid #ccc; +}
\ No newline at end of file diff --git a/assets/e96affe6/gridview/up.gif b/assets/e96affe6/gridview/up.gif Binary files differnew file mode 100644 index 0000000..890b038 --- /dev/null +++ b/assets/e96affe6/gridview/up.gif diff --git a/assets/e96affe6/gridview/update.png b/assets/e96affe6/gridview/update.png Binary files differnew file mode 100644 index 0000000..438b7c1 --- /dev/null +++ b/assets/e96affe6/gridview/update.png diff --git a/assets/e96affe6/gridview/view.png b/assets/e96affe6/gridview/view.png Binary files differnew file mode 100644 index 0000000..cadbec3 --- /dev/null +++ b/assets/e96affe6/gridview/view.png diff --git a/assets/e96affe6/listview/down.gif b/assets/e96affe6/listview/down.gif Binary files differnew file mode 100644 index 0000000..a4933b8 --- /dev/null +++ b/assets/e96affe6/listview/down.gif diff --git a/assets/e96affe6/listview/jquery.yiilistview.js b/assets/e96affe6/listview/jquery.yiilistview.js new file mode 100644 index 0000000..682402f --- /dev/null +++ b/assets/e96affe6/listview/jquery.yiilistview.js @@ -0,0 +1,114 @@ +/** + * jQuery Yii ListView plugin file. + * + * @author Qiang Xue <qiang.xue@gmail.com> + * @link http://www.yiiframework.com/ + * @copyright Copyright © 2008-2010 Yii Software LLC + * @license http://www.yiiframework.com/license/ + * @version $Id: jquery.yiilistview.js 3296 2011-06-22 17:15:17Z qiang.xue $ + */ + +;(function($) { + /** + * yiiListView set function. + * @param options map settings for the list view. Availablel options are as follows: + * - ajaxUpdate: array, IDs of the containers whose content may be updated by ajax response + * - ajaxVar: string, the name of the GET variable indicating the ID of the element triggering the AJAX request + * - pagerClass: string, the CSS class for the pager container + * - sorterClass: string, the CSS class for the sorter container + * - updateSelector: string, the selector for choosing which elements can trigger ajax requests + * - beforeAjaxUpdate: function, the function to be called before ajax request is sent + * - afterAjaxUpdate: function, the function to be called after ajax response is received + */ + $.fn.yiiListView = function(options) { + return this.each(function(){ + var settings = $.extend({}, $.fn.yiiListView.defaults, options || {}); + var $this = $(this); + var id = $this.attr('id'); + if(settings.updateSelector == undefined) { + settings.updateSelector = '#'+id+' .'+settings.pagerClass.replace(/\s+/g,'.')+' a, #'+id+' .'+settings.sorterClass.replace(/\s+/g,'.')+' a'; + } + $.fn.yiiListView.settings[id] = settings; + + if(settings.ajaxUpdate.length > 0) { + $(settings.updateSelector).die('click').live('click',function(){ + $.fn.yiiListView.update(id, {url: $(this).attr('href')}); + return false; + }); + } + }); + }; + + $.fn.yiiListView.defaults = { + ajaxUpdate: [], + ajaxVar: 'ajax', + pagerClass: 'pager', + loadingClass: 'loading', + sorterClass: 'sorter' + // updateSelector: '#id .pager a, '#id .sort a', + // beforeAjaxUpdate: function(id) {}, + // afterAjaxUpdate: function(id, data) {}, + // url: 'ajax request URL' + }; + + $.fn.yiiListView.settings = {}; + + /** + * Returns the key value for the specified row + * @param id string the ID of the list view container + * @param index integer the zero-based index of the data item + * @return string the key value + */ + $.fn.yiiListView.getKey = function(id, index) { + return $('#'+id+' > div.keys > span:eq('+index+')').text(); + }; + + /** + * Returns the URL that generates the list view content. + * @param id string the ID of the list view container + * @return string the URL that generates the list view content. + */ + $.fn.yiiListView.getUrl = function(id) { + var settings = $.fn.yiiListView.settings[id]; + return settings.url || $('#'+id+' > div.keys').attr('title'); + }; + + /** + * Performs an AJAX-based update of the list view contents. + * @param id string the ID of the list view container + * @param options map the AJAX request options (see jQuery.ajax API manual). By default, + * the URL to be requested is the one that generates the current content of the list view. + */ + $.fn.yiiListView.update = function(id, options) { + var settings = $.fn.yiiListView.settings[id]; + $('#'+id).addClass(settings.loadingClass); + options = $.extend({ + type: 'GET', + url: $.fn.yiiListView.getUrl(id), + success: function(data,status) { + $.each(settings.ajaxUpdate, function(i,v) { + var id='#'+v; + $(id).replaceWith($(id,'<div>'+data+'</div>')); + }); + if(settings.afterAjaxUpdate != undefined) + settings.afterAjaxUpdate(id, data); + $('#'+id).removeClass(settings.loadingClass); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + $('#'+id).removeClass(settings.loadingClass); + alert(XMLHttpRequest.responseText); + } + }, options || {}); + + if(options.data!=undefined && options.type=='GET') { + options.url = $.param.querystring(options.url, options.data); + options.data = {}; + } + options.url = $.param.querystring(options.url, settings.ajaxVar+'='+id); + + if(settings.beforeAjaxUpdate != undefined) + settings.beforeAjaxUpdate(id); + $.ajax(options); + }; + +})(jQuery);
\ No newline at end of file diff --git a/assets/e96affe6/listview/loading.gif b/assets/e96affe6/listview/loading.gif Binary files differnew file mode 100644 index 0000000..5b33f7e --- /dev/null +++ b/assets/e96affe6/listview/loading.gif diff --git a/assets/e96affe6/listview/styles.css b/assets/e96affe6/listview/styles.css new file mode 100644 index 0000000..974507c --- /dev/null +++ b/assets/e96affe6/listview/styles.css @@ -0,0 +1,56 @@ +.list-view-loading +{ + background:url(loading.gif) no-repeat; +} + +.list-view .summary +{ + margin: 0 0 5px 0; + text-align: right; +} + +.list-view .sorter +{ + margin: 0 0 5px 0; + text-align: right; +} + +.list-view .pager +{ + margin: 5px 0 0 0; + text-align: right; +} + +.list-view .sorter +{ + font-size: 0.9em; +} + +.list-view .sorter ul +{ + display: inline; + list-style-image:none; + list-style-position:outside; + list-style-type:none; + margin:0; + padding:0; +} + +.list-view .sorter li +{ + display: inline; + margin: 0 0 0 5px; + padding: 0; +} + +.list-view .sorter a.asc +{ + background:url(up.gif) right center no-repeat; + padding-right: 10px; +} + +.list-view .sorter a.desc +{ + background:url(down.gif) right center no-repeat; + padding-right: 10px; +} diff --git a/assets/e96affe6/listview/up.gif b/assets/e96affe6/listview/up.gif Binary files differnew file mode 100644 index 0000000..890b038 --- /dev/null +++ b/assets/e96affe6/listview/up.gif diff --git a/protected/config/main.php b/protected/config/main.php index 7207120..32a7021 100644 --- a/protected/config/main.php +++ b/protected/config/main.php @@ -16,6 +16,7 @@ return array( 'import'=>array( 'application.models.*', 'application.components.*', + 'application.extensions.ddeditor.*', ), 'modules'=>array( @@ -51,15 +52,16 @@ return array( 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db', ), // uncomment the following to use a MySQL database - /* + 'db'=>array( - 'connectionString' => 'mysql:host=localhost;dbname=testdrive', + 'connectionString' => 'mysql:host=localhost;dbname=astaf', 'emulatePrepare' => true, 'username' => 'root', 'password' => '', 'charset' => 'utf8', + 'tablePrefix' => 'tbl_' ), - */ + 'errorHandler'=>array( // use 'site/error' action to display errors 'errorAction'=>'site/error', diff --git a/protected/controllers/CmsPageController.php b/protected/controllers/CmsPageController.php new file mode 100644 index 0000000..362f991 --- /dev/null +++ b/protected/controllers/CmsPageController.php @@ -0,0 +1,176 @@ +<?php + +class CmsPageController extends Controller +{ + /** + * @var string the default layout for the views. Defaults to '//layouts/column2', meaning + * using two-column layout. See 'protected/views/layouts/column2.php'. + */ + public $layout='//layouts/column2'; + + /** + * @return array action filters + */ + public function filters() + { + return array( + 'accessControl', // perform access control for CRUD operations + ); + } + + /** + * Specifies the access control rules. + * This method is used by the 'accessControl' filter. + * @return array access control rules + */ + public function accessRules() + { + return array( + array('allow', // allow all users to perform 'index' and 'view' actions + 'actions'=>array('index','view'), + 'users'=>array('*'), + ), + array('allow', // allow authenticated user to perform 'create' and 'update' actions + 'actions'=>array('create','update'), + 'users'=>array('@'), + ), + array('allow', // allow admin user to perform 'admin' and 'delete' actions + 'actions'=>array('admin','delete'), + 'users'=>array('admin'), + ), + array('deny', // deny all users + 'users'=>array('*'), + ), + ); + } + + /** + * Displays a particular model. + * @param integer $id the ID of the model to be displayed + */ + public function actionView($id) + { + $this->render('view',array( + 'model'=>$this->loadModel($id), + )); + } + + /** + * Creates a new model. + * If creation is successful, the browser will be redirected to the 'view' page. + */ + public function actionCreate() + { + $model=new CmsPage; + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['CmsPage'])) + { + $model->attributes=$_POST['CmsPage']; + if($model->save()) + $this->redirect(array('view','id'=>$model->id)); + } + + $this->render('create',array( + 'model'=>$model, + )); + } + + /** + * Updates a particular model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id the ID of the model to be updated + */ + public function actionUpdate($id) + { + $model=$this->loadModel($id); + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['CmsPage'])) + { + $model->attributes=$_POST['CmsPage']; + if($model->save()) + $this->redirect(array('view','id'=>$model->id)); + } + + $this->render('update',array( + 'model'=>$model, + )); + } + + /** + * Deletes a particular model. + * If deletion is successful, the browser will be redirected to the 'admin' page. + * @param integer $id the ID of the model to be deleted + */ + public function actionDelete($id) + { + if(Yii::app()->request->isPostRequest) + { + // we only allow deletion via POST request + $this->loadModel($id)->delete(); + + // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser + if(!isset($_GET['ajax'])) + $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); + } + else + throw new CHttpException(400,'Invalid request. Please do not repeat this request again.'); + } + + /** + * Lists all models. + */ + public function actionIndex() + { + $dataProvider=new CActiveDataProvider('CmsPage'); + $this->render('index',array( + 'dataProvider'=>$dataProvider, + )); + } + + /** + * Manages all models. + */ + public function actionAdmin() + { + $model=new CmsPage('search'); + $model->unsetAttributes(); // clear any default values + if(isset($_GET['CmsPage'])) + $model->attributes=$_GET['CmsPage']; + + $this->render('admin',array( + 'model'=>$model, + )); + } + + /** + * Returns the data model based on the primary key given in the GET variable. + * If the data model is not found, an HTTP exception will be raised. + * @param integer the ID of the model to be loaded + */ + public function loadModel($id) + { + $model=CmsPage::model()->findByPk($id,"status=".CmsPage::STATUS_PUBLISHED); + if($model===null) + throw new CHttpException(404,'The requested page does not exist.'); + return $model; + } + + /** + * Performs the AJAX validation. + * @param CModel the model to be validated + */ + protected function performAjaxValidation($model) + { + if(isset($_POST['ajax']) && $_POST['ajax']==='cms-page-form') + { + echo CActiveForm::validate($model); + Yii::app()->end(); + } + } +} diff --git a/protected/extensions/ddeditor/DDEditor.php b/protected/extensions/ddeditor/DDEditor.php new file mode 100644 index 0000000..798ef90 --- /dev/null +++ b/protected/extensions/ddeditor/DDEditor.php @@ -0,0 +1,228 @@ +<?php +/** + * DDEditor Class File + * + * @author Joachim Werner <joachim.werner@diggin-data.de> + * @link http://www.diggin-data.de + */ + +/** + * DDEditor creates a textarea editor for Markdown syntax + * The editor has some buttons to replace selected text in a textarea + * with common Mardown syntax + * + * @author Joachim Werner <joachim.werner@diggin-data.de> + * @version 0.4 + */ +class DDEditor extends CWidget +{ + // {{{ Members + /** + * model - The model upon which the activeTextarea control is based on + * + * @var mixed + * @access public + */ + public $model; + /** + * The attribute name for which the activeTextarea control shall be created + * @var mixed + * @access public + */ + public $attribute; + /** + * Array of additional HTML options for the textarea control + * + * @var array + * @access public + */ + public $htmlOptions=array(); + public $additionalSnippets = array(); + /** + * Request which returns via AJAX the rendered preview for the Markdown text + * + * @var mixed + * @access public + */ + public $previewRequest; + /** + * The ID of the activeTextarea + * + * @var mixed + * @access private + */ + private $editorId; + // }}} + // {{{ run + /** + * Runs the widget + * + * @access public + * @return void + */ + public function run() + { + $this->registerClientScripts(); + echo $this->createMarkup(); + } // }}} + // {{{ createMarkup + /** + * Creates the widget's markup + * + * @access public + * @return void + */ + public function createMarkup() + { + if(!isset($this->htmlOptions['rows'])) { + $attribute = $this->attribute; + $text = $this->model->$attribute; + if (strpos($text, "\n") === FALSE) { + //MAC?! + $text = str_replace( "\r", "\n", $text ); + } else { + //Windows has \r\n + $text = str_replace( "\r", '', $text ); + } + $this->htmlOptions['rows'] = count(explode("\n", $text)); + } + $this->render( + 'editor', + array( + 'model'=>$this->model, + 'attribute'=>$this->attribute, + 'htmlOptions'=>$this->htmlOptions, + 'editorId' => $this->editorId, + 'additionalSnippets'=>$this->additionalSnippets, + ) + ); + } // }}} + // {{{ registerClientScripts + /** + * Registers the clientside widget files (css & js) + */ + private function registerClientScripts() { + // Get the resources path + $resources = dirname(__FILE__).'/resources'; + + $cs = Yii::app()->clientScript; + // publish the files + $baseUrl = Yii::app()->assetManager->publish($resources); + + // register the files + + // Stylesheet + if(is_file($resources.'/styles.css')) { + $cs->registerCssFile($baseUrl.'/styles.css'); + } + if(is_file($resources.'/editor.js')) { + $cs->registerScriptFile($baseUrl.'/editor.js'); + } + self::resolveNameID($this->model,$this->attribute,$this->htmlOptions); + $this->editorId = $this->htmlOptions['id']; + $c=1; + // Create preview request URL + $url = Yii::app()->urlManager->createUrl($this->previewRequest,array('attribute'=>$this->attribute)); + + $scriptId = uniqid('ed_').'_'; + // Bold + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-bold').click(function(){insertTags('".$this->editorId."','**','**','bold ')});"); + // Italic + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-italic').click(function(){insertTags('".$this->editorId."','_','_','italic ')});"); + // Headings + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-h').change(function(){insertTags('".$this->editorId."',padText('#',this.value)+' ',' '+padText('#',this.value),'Heading '+this.value)});"); + // Link + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-link').click(function(){insertTags('".$this->editorId."','[','](http://...)','Link Description')});"); + // Image + // $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-img').click(function(){insertTags('".$this->editorId."','','Image URL')});"); + // Image 2 + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-img2').change(function(){insertTags('".$this->editorId."',this.value+'[Heading/Alt Text](',' \"Title\")','path/to/image.jpg')});"); + // List Item + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-li').click(function(){insertTags('".$this->editorId."','* ','','List Item ')});"); + // HR + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-hr').click(function(){insertTags('".$this->editorId."','****bslashN','','')});"); + // Table + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-table').click(function(){insertTags('".$this->editorId."','| Header | Header |bslashN| ------ | ------ | bslashN| ',' | Cell |bslashN','Cell')});"); + // Code + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-code').click(function(){insertTags('".$this->editorId."','`','`','sample code')});"); + // Code2 + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-code2').click(function(){if(this.value=='') return;insertTags('".$this->editorId."','~~~~bslashN['+this.value+']bslashN','bslashN~~~~bslashN','// Sample Ccode')});"); + // Add Lines + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-addlines').click(function(){jQuery('#".$this->editorId."').attr('rows',jQuery('#".$this->editorId."').attr('rows')+5);});"); + // Remove Lines + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-remlines').click(function(){jQuery('#".$this->editorId."').attr('rows',jQuery('#".$this->editorId."').attr('rows')-5);});"); + // Preview + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-preview').click(function(){jQuery('#".$this->editorId."').toggle();jQuery('#".$this->editorId."-preview').toggle();jQuery.ajax({type:'POST',url: '".$url."',data: jQuery(':parent form').serialize(),success:function(data){jQuery('#".$this->editorId."-preview').html(data);}});});"); + // Additional Snippets + if(sizeof($this->additionalSnippets)>0) { + $n=0; + foreach($this->additionalSnippets as $name=>$additionalSnippet) { + $ddId = $this->editorId."-editor-addS-".$n; + $cs->registerScript($scriptId.$c++,"jQuery('#".$ddId."').change(function(){insertTags('".$this->editorId."','','',this.value);this.selectedIndex=0;});"); + $n++; + } + } + } // }}} + // {{{ resolveNameID + /** + * Generates input name and ID for a model attribute. + * This method will update the HTML options by setting appropriate 'name' and 'id' attributes. + * This method may also modify the attribute name if the name + * contains square brackets (mainly used in tabular input). + * @param CModel the data model + * @param string the attribute + * @param array the HTML options + */ + public static function resolveNameID($model,&$attribute,&$htmlOptions) + { + if(!isset($htmlOptions['name'])) + $htmlOptions['name']=self::resolveName($model,$attribute); + if(!isset($htmlOptions['id'])) + $htmlOptions['id']=self::getIdByName($htmlOptions['name']); + else if($htmlOptions['id']===false) + unset($htmlOptions['id']); + } // }}} + // {{{ getIdByName + /** + * Generates a valid HTML ID based the name. + * @return string the ID generated based on name. + */ + public static function getIdByName($name) + { + return str_replace(array('[]', '][', '[', ']'), array('', '_', '_', ''), $name); + } // }}} + // {{{ resolveName + /** + * Generates input name for a model attribute. + * Note, the attribute name may be modified after calling this method if the name + * contains square brackets (mainly used in tabular input) before the real attribute name. + * @param CModel the data model + * @param string the attribute + * @return string the input name + * @since 1.0.2 + */ + public static function resolveName($model,&$attribute) + { + if(($pos=strpos($attribute,'['))!==false) + { + if($pos!==0) // e.g. name[a][b] + return get_class($model).'['.substr($attribute,0,$pos).']'.substr($attribute,$pos); + if(($pos=strrpos($attribute,']'))!==false && $pos!==strlen($attribute)-1) // e.g. [a][b]name + { + $sub=substr($attribute,0,$pos+1); + $attribute=substr($attribute,$pos+1); + return get_class($model).$sub.'['.$attribute.']'; + } + if(preg_match('/\](\w+\[.*)$/',$attribute,$matches)) + { + $name=get_class($model).'['.str_replace(']','][',trim(strtr($attribute,array(']['=>']','['=>']')),']')).']'; + $attribute=$matches[1]; + return $name; + } + } + else + return get_class($model).'['.$attribute.']'; + } // }}} +} + +/* vim: set ai sw=4 sts=4 et fdm=marker fdc=4: */ diff --git a/protected/extensions/ddeditor/README b/protected/extensions/ddeditor/README new file mode 100644 index 0000000..0d5e252 --- /dev/null +++ b/protected/extensions/ddeditor/README @@ -0,0 +1,108 @@ +# DDEditor Yii Extension + +This extension contains a widget to render an activeTextarea to enter Markdown text. + +The rendered widget contains some buttons to add markdown tags for + +* Bold, italic text +* Links +* Images +* Code +* Table structure. + +It is also capable of displaying dropdown lists with _additional text snippets_ for insertion. + + +### Requirements +* Yii 1.1.3 or above + +### Installation +* Extract the release file under `protected/extensions` + +### Usage + +#### Include New Extension + +In your `config/main.php` file, add + + // autoloading model and component classes + 'import'=>array( + ... + 'application.extensions.ddeditor.*', + ... + ), + +#### Create the controll in a form view: + +In e.g. `views/post/_form.php`, include the following code: + + <?php $this->widget( + 'application.extensions.ddeditor.DDEditor', + array( + 'model'=>$model, + 'attribute'=>'content', + 'htmlOptions'=>array('rows'=>10, 'cols'=>70), + 'previewRequest'=>'post/preview')); ?> + +If you want to display an **extra dropdown list** with **snippets**, you may add the +_additionalSnippets_ parameter: + + <?php $mySnippets = array( + 'Users' => array( + 'id1' => 'John', + 'id2' => 'Paul', + ), + 'Phrases' => array( + 'Text Foo' => 'foo', + 'Text Bar' => 'bar' + ) + ); ?> + + <?php $this->widget( + 'application.extensions.ddeditor.DDEditor', + array( + 'model'=>$model, + 'attribute'=>'content', + 'htmlOptions'=>array('rows'=>10, 'cols'=>70), + 'previewRequest'=>'post/preview', + 'additionalSnippets'=>array('My Snippets'=>$mySnippets), + ); ?> + + +#### Add a Controller Preview Action + +In order to receive a rendered preview of the textarea Markdown, add an action method to a controller: + + public function actionPreview() + { + $parser=new CMarkdownParser; + echo $parser->safeTransform($_POST['Post'][$_GET['attribute']]); + } + + +### Resources + +* [Demo](http://www.diggin-data.de/ddeditor) +* [Discussion](http://www.yiiframework.com/forum/index.php?/topic/11384-new-extension-markdown-editor) + + +### Changes + +#### March 29, 2010 +* **V0.4** + * Added code sample for using _additionalSnippets_ in README + * Added reset of _additional snippets_ dropdown list after selection + +#### March 28, 2010 +* **V0.3** + * Fixed _Depreciated: split_ warning + * Added _additionalSnippets_ member + * Added _Code Highlighter_ dropdown list + +#### August 31, 2010 +* **V0.2** + * Fixed setting `$previewReaquest` + * Fixed setting client script id's for using multiple editors in one form + +#### August 30, 2010 +* **V0.1** Initial release. diff --git a/protected/extensions/ddeditor/messages/de/ddeditor.php b/protected/extensions/ddeditor/messages/de/ddeditor.php new file mode 100644 index 0000000..390b819 --- /dev/null +++ b/protected/extensions/ddeditor/messages/de/ddeditor.php @@ -0,0 +1,33 @@ +<?php +/** + * Message translations. + * + * This file is automatically generated by 'yiic message' command. + * It contains the localizable messages extracted from source code. + * You may modify this file by translating the extracted messages. + * + * Each array element represents the translation (value) of a message (key). + * If the value is empty, the message is considered as not translated. + * Messages that no longer need translation will have their translations + * enclosed between a pair of '@@' marks. + * + * Message string can be used with plural forms format. Check i18n section + * of the guide for details. + * + * NOTE, this file must be saved in UTF-8 encoding. + * + * @version $Id: $ + */ +return array ( + 'Code' => 'Code', + 'Highslide' => 'Highslide', + 'IMG' => 'BILD', + 'Inline' => 'Im Fließtext', + 'B' => 'F', + 'H' => 'Ü', + 'HR' => 'HR', + 'I' => 'K', + 'Loading Preview...' => 'Lade Vorschau...', + 'Preview' => 'Vorschau', + 'Table' => 'Tabelle', +); diff --git a/protected/extensions/ddeditor/messages/en/ddeditor.php b/protected/extensions/ddeditor/messages/en/ddeditor.php new file mode 100644 index 0000000..df2b3b0 --- /dev/null +++ b/protected/extensions/ddeditor/messages/en/ddeditor.php @@ -0,0 +1,26 @@ +<?php +/** + * Message translations. + * + * This file is automatically generated by 'yiic message' command. + * It contains the localizable messages extracted from source code. + * You may modify this file by translating the extracted messages. + * + * Each array element represents the translation (value) of a message (key). + * If the value is empty, the message is considered as not translated. + * Messages that no longer need translation will have their translations + * enclosed between a pair of '@@' marks. + * + * NOTE, this file must be saved in UTF-8 encoding. + * + * @version $Id: $ + */ +return array ( + 'B' => '', + 'H' => '', + 'HR' => '', + 'I' => '', + 'Loading Preview...' => '', + 'Preview' => '', + 'Table' => '', +); diff --git a/protected/extensions/ddeditor/messages/en/ddeditor.php.merged b/protected/extensions/ddeditor/messages/en/ddeditor.php.merged new file mode 100644 index 0000000..15f12bb --- /dev/null +++ b/protected/extensions/ddeditor/messages/en/ddeditor.php.merged @@ -0,0 +1,33 @@ +<?php +/** + * Message translations. + * + * This file is automatically generated by 'yiic message' command. + * It contains the localizable messages extracted from source code. + * You may modify this file by translating the extracted messages. + * + * Each array element represents the translation (value) of a message (key). + * If the value is empty, the message is considered as not translated. + * Messages that no longer need translation will have their translations + * enclosed between a pair of '@@' marks. + * + * Message string can be used with plural forms format. Check i18n section + * of the guide for details. + * + * NOTE, this file must be saved in UTF-8 encoding. + * + * @version $Id: $ + */ +return array ( + 'B' => '', + 'Code' => '', + 'H' => '', + 'HR' => '', + 'Highslide' => '', + 'I' => '', + 'IMG' => '', + 'Inline' => '', + 'Loading Preview...' => '', + 'Preview' => '', + 'Table' => '', +); diff --git a/protected/extensions/ddeditor/messages/messages.php b/protected/extensions/ddeditor/messages/messages.php new file mode 100644 index 0000000..3de8acf --- /dev/null +++ b/protected/extensions/ddeditor/messages/messages.php @@ -0,0 +1,17 @@ +<?php +// This is hopefully a config array for the messages +return array( + 'sourcePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..', //root dir of all source + 'messagePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'messages', //root dir of message translations + 'languages' => array('de','en'), //array of lang codes to translate to, e.g. es_mx + 'fileTypes' => array('php','js',), //array of extensions no dot all others excluded + 'exclude' => array( //list of paths or files to exclude + '.svn', + 'yiic', + 'yiic.php', + '/gii', + '/messages', + ), + //'translator' => 'Yii:t', //this is the default but lets be complete +); +?> diff --git a/protected/extensions/ddeditor/resources/editor.js b/protected/extensions/ddeditor/resources/editor.js new file mode 100644 index 0000000..7317d3b --- /dev/null +++ b/protected/extensions/ddeditor/resources/editor.js @@ -0,0 +1,140 @@ +/** + * Some browser detection + */ +var clientPC = navigator.userAgent.toLowerCase(); // Get client info +var is_gecko = ((clientPC.indexOf('gecko')!=-1) && (clientPC.indexOf('spoofer')==-1) + && (clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0')==-1)); +var is_safari = ((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1)); +var is_khtml = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled )); +if (clientPC.indexOf('opera')!=-1) { + var is_opera = true; + var is_opera_preseven = (window.opera && !document.childNodes); + var is_opera_seven = (window.opera && document.childNodes); +} + +//{{{ insertTags +/** + * apply tagOpen/tagClose to selection in textarea, use sampleText instead + * of selection if there is none copied and adapted from phpBB + * + * @author phpBB development team + * @author MediaWiki development team + * @author Andreas Gohr <andi@splitbrain.org> + * @author Jim Raynor <jim_raynor@web.de> + */ +function insertTags(elID, tagOpen, tagClose, sampleText) { + tagOpen = tagOpen.replace(/bslashN/g,'\n'); + tagClose = tagClose.replace(/bslashN/g,'\n'); + var txtarea = document.getElementById(elID); + // IE + if(document.selection && !is_gecko) { + var theSelection = document.selection.createRange().text; + var replaced = true; + if(!theSelection){ + replaced = false; + theSelection=sampleText; + } + txtarea.focus(); + + // This has change + text = theSelection; + if(theSelection.charAt(theSelection.length - 1) == " "){// exclude ending space char, if any + theSelection = theSelection.substring(0, theSelection.length - 1); + r = document.selection.createRange(); + r.text = tagOpen + theSelection + tagClose + " "; + } else { + r = document.selection.createRange(); + r.text = tagOpen + theSelection + tagClose; + } + if(!replaced){ + r.moveStart('character',-text.length-tagClose.length); + r.moveEnd('character',-tagClose.length); + } + r.select(); + // Mozilla + } else if(txtarea.selectionStart || txtarea.selectionStart == '0') { + var replaced = false; + var startPos = txtarea.selectionStart; + var endPos = txtarea.selectionEnd; + if(endPos - startPos) replaced = true; + var scrollTop=txtarea.scrollTop; + var myText = (txtarea.value).substring(startPos, endPos); + if(!myText) { myText=sampleText;} + if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any + subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; + } else { + subst = tagOpen + myText + tagClose; + } + txtarea.value = txtarea.value.substring(0, startPos) + subst + + txtarea.value.substring(endPos, txtarea.value.length); + txtarea.focus(); + + //set new selection + if(replaced){ + var cPos=startPos+(tagOpen.length+myText.length+tagClose.length); + txtarea.selectionStart=cPos; + txtarea.selectionEnd=cPos; + }else{ + txtarea.selectionStart=startPos+tagOpen.length; + txtarea.selectionEnd=startPos+tagOpen.length+myText.length; + } + txtarea.scrollTop=scrollTop; + // All others + } else { + var copy_alertText=alertText; + var re1=new RegExp("\\$1","g"); + var re2=new RegExp("\\$2","g"); + copy_alertText=copy_alertText.replace(re1,sampleText); + copy_alertText=copy_alertText.replace(re2,tagOpen+sampleText+tagClose); + var text; + if (sampleText) { + text=prompt(copy_alertText); + } else { + text=""; + } + if(!text) { text=sampleText;} + text=tagOpen+text+tagClose; + //append to the end + txtarea.value += "\n"+text; + + // in Safari this causes scrolling + if(!is_safari) { + txtarea.focus(); + } + + } + // reposition cursor if possible + if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate(); + + return false; +} +// }}} + +// {{{ moreRows +/** + * Adds 2 more rows to a textarea + */ +function moreRows(textareaId) +{ + document.getElementById(textareaId).rows = document.getElementById(textareaId).rows + 2; +} // }}} + +// {{{ lessRows +/** + * Reduces a textarea by 2 rows + */ +function lessRows(textareaId) +{ + if( document.getElementById(textareaId).rows>2 ) + document.getElementById(textareaId).rows = document.getElementById(textareaId).rows - 2; +}// }}} + +// {{{ padText +function padText(text, length) +{ + var result=""; + for(i=0; i<length; i++) + result = result + text; + return result; +} +// }}} diff --git a/protected/extensions/ddeditor/resources/styles.css b/protected/extensions/ddeditor/resources/styles.css new file mode 100644 index 0000000..0568bd3 --- /dev/null +++ b/protected/extensions/ddeditor/resources/styles.css @@ -0,0 +1,15 @@ +.ddeditor .preview +{ + display: none; + border: 1px solid #aaa; + padding: 3px; +} +.ddeditor BUTTON,SELECT +{ + font-size: 9pt; +} +.ddeditor BUTTON +{ + border: 1px solid blue; + background-color: #eee; +} diff --git a/protected/extensions/ddeditor/views/editor.php b/protected/extensions/ddeditor/views/editor.php new file mode 100644 index 0000000..e8ab7be --- /dev/null +++ b/protected/extensions/ddeditor/views/editor.php @@ -0,0 +1,63 @@ +<div class="ddeditor"> +<button + type="button" + id="<?php echo $editorId ?>-editor-bold"><b><?php echo Yii::t('ddeditor','B'); ?></b></button> +<button + type="button" + id="<?php echo $editorId ?>-editor-italic"><i><?php echo Yii::t('ddeditor','I'); ?></i></button> +<select id="<?php echo $editorId ?>-editor-h"> + <option value=""><?php echo Yii::t('ddeditor','H'); ?></option> + <?php for($i=1; $i<=5; $i++ ) : ?> + <option value="<?php echo $i ?>"><?php echo Yii::t('ddeditor','H'); ?><?php echo $i ?></option> + <?php endfor; ?> +</select> +<button + type="button" + id="<?php echo $editorId ?>-editor-link">URL</button> +<!-- +<button + type="button" + id="<?php echo $editorId ?>-editor-img">IMG</button> +--> +<select id="<?php echo $editorId ?>-editor-img2"> + <option value=""><?php echo Yii::t('ddeditor','IMG'); ?></option> + <option value="!"><?php echo Yii::t('ddeditor','Inline'); ?></option> + <option value="*"><?php echo Yii::t('ddeditor','Highslide'); ?></option> +</select> +<button + type="button" + id="<?php echo $editorId ?>-editor-li">•</button> +<button + type="button" + id="<?php echo $editorId ?>-editor-hr"><?php echo Yii::t('ddeditor','HR'); ?></button> +<button + type="button" + id="<?php echo $editorId ?>-editor-code">Code</button> +<select id="<?php echo $editorId ?>-editor-code2"> + <option value=""><?php echo Yii::t('ddeditor','Code'); ?></option> + <?php foreach(explode(", ","ABAP, CPP, CSS, DIFF, DTD, HTML, JAVA, JAVASCRIPT, MYSQL, PERL, PHP, PYTHON, RUBY, SQL, XML") as $language) : ?> + <option value="<?php echo strtolower($language) ?>"><?php echo $language; ?></option> + <?php endforeach; ?> +</select> +<button + type="button" + id="<?php echo $editorId ?>-editor-table"><?php echo Yii::t('ddeditor','Table'); ?></button> +<button + type="button" + id="<?php echo $editorId; ?>-editor-addlines">+</button> +<button + type="button" + id="<?php echo $editorId; ?>-editor-remlines">-</button> +<button + type="button" + id="<?php echo $editorId; ?>-editor-preview"><?php echo Yii::t('ddeditor','Preview'); ?></button> +<br/> +<?php if(sizeof($additionalSnippets)>0) : ?> +<?php $n=0; foreach($additionalSnippets as $name=>$additionalSnippet) : $additionalSnippet = array_merge(array($name),$additionalSnippet); ?> +<?php echo CHtml::dropDownList($editorId.'-editor-addS-'.$n,'',$additionalSnippet); ?> +<?php $n++; endforeach; ?> +<br/> +<?php endif; ?> +<?php echo CHtml::activeTextArea($model,$attribute,$htmlOptions); ?> +<div id="<?php echo $editorId; ?>-preview" class="preview"><?php echo Yii::t('ddeditor','Loading Preview...'); ?></div> +</div> diff --git a/protected/models/CmsPage.php b/protected/models/CmsPage.php new file mode 100644 index 0000000..92acf23 --- /dev/null +++ b/protected/models/CmsPage.php @@ -0,0 +1,133 @@ +<?php + +/** + * This is the model class for table "{{cms_page}}". + * + * The followings are the available columns in table '{{cms_page}}': + * @property integer $id + * @property string $content + * @property string $title + * @property string $create_time + * @property string $update_time + * @property integer $status + * @property string $slug + */ +class CmsPage extends CActiveRecord +{ + + + const STATUS_PUBLISHED=1; + const STATUS_DRAFT=2; + const STATUS_DELETED=3; + /** + * Returns the static model of the specified AR class. + * @param string $className active record class name. + * @return CmsPage the static model class + */ + public static function model($className=__CLASS__) + { + return parent::model($className); + } + + /** + * @return string the associated database table name + */ + public function tableName() + { + return '{{cms_page}}'; + } + + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + // NOTE: you should only define rules for those attributes that + // will receive user inputs. + return array( + array('content, title, status, slug', 'required'), + array('status', 'numerical', 'integerOnly'=>true), + array('status', 'in', 'range'=>array(1,2,3)), + array('title, slug', 'length', 'max'=>255), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, content, title, create_time, update_time, status, slug', 'safe', 'on'=>'search'), + //array('title, status', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'content' => 'Content', + 'title' => 'Title', + 'create_time' => 'Create Time', + 'update_time' => 'Update Time', + 'status' => 'Status', + 'slug' => 'Slug', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('content',$this->content,true); + $criteria->compare('title',$this->title,true); + $criteria->compare('create_time',$this->create_time,true); + $criteria->compare('update_time',$this->update_time,true); + $criteria->compare('status',$this->status); + $criteria->compare('slug',$this->slug,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } + + public function getUrl() + { + return Yii::app()->createUrl('cms', array( + 'slug'=>$this->slug, + )); + } + + protected function beforeSave() + { + if(parent::beforeSave()) + { + if($this->isNewRecord) + { + $this->create_time=$this->update_time=new CDbExpression('NOW()'); + //$this->author_id=Yii::app()->user->id; + } + else + $this->update_time=new CDbExpression('NOW()'); + return true; + } + else + return false; + } +}
\ No newline at end of file diff --git a/protected/runtime/HTML/4.4.0,7dbdc3d58ab57a278defc6669c7aa098,1.ser b/protected/runtime/HTML/4.4.0,7dbdc3d58ab57a278defc6669c7aa098,1.ser Binary files differnew file mode 100644 index 0000000..d5dc58e --- /dev/null +++ b/protected/runtime/HTML/4.4.0,7dbdc3d58ab57a278defc6669c7aa098,1.ser diff --git a/protected/runtime/application.log b/protected/runtime/application.log new file mode 100644 index 0000000..03f7301 --- /dev/null +++ b/protected/runtime/application.log @@ -0,0 +1,204 @@ +2012/04/15 14:23:30 [error] [exception.CException] exception 'CException' with message 'Property "CDbConnection.tablePfrefix" is not defined.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CComponent.php:174 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\YiiBase.php(222): CComponent->__set('tablePfrefix', 'tbl_') +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CModule.php(387): YiiBase::createComponent(Array) +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CModule.php(104): CModule->getComponent('db') +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\gii\generators\model\ModelCode.php(54): CModule->__get('db') +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CFormModel.php(40): ModelCode->init() +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\gii\CCodeGenerator.php(152): CFormModel->__construct() +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\gii\CCodeGenerator.php(64): CCodeGenerator->prepare() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(50): CCodeGenerator->actionIndex() +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(287): CController->runAction(Object(CInlineAction)) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('') +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('gii/model') +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#15 {main} +REQUEST_URI=/index.php?r=gii/model +HTTP_REFERER=http://localhost/index.php?r=gii +--- +2012/04/15 16:20:28 [warning] [application] Failed to set unsafe attribute "create_time" of "CmsPage". +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php (71) +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php (13) +2012/04/15 16:20:28 [warning] [application] Failed to set unsafe attribute "updatetime" of "CmsPage". +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php (71) +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php (13) +2012/04/15 17:11:31 [error] [exception.CException] exception 'CException' with message 'Property "CmsPage.updatetime" is not defined.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CComponent.php:174 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(160): CComponent->__set('updatetime', 1334502691) +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\models\CmsPage.php(122): CActiveRecord->__set('updatetime', 1334502691) +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(1056): CmsPage->beforeSave() +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(787): CActiveRecord->update(NULL) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(96): CActiveRecord->save() +#5 [internal function]: CmsPageController->actionUpdate('1') +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#16 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('update') +#17 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/update') +#18 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#19 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#20 {main} +REQUEST_URI=/index.php?r=cmsPage/update&id=1 +HTTP_REFERER=http://localhost/index.php?r=cmsPage/update&id=1 +--- +2012/04/15 17:26:25 [error] [php] Object of class DateTime could not be converted to string (D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\schema\CDbColumnSchema.php:141) +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(787): CmsPage->insert() +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(72): CmsPage->save() +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(50): CmsPageController->actionCreate() +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams() +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CmsPageController->runAction() +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CAccessControlFilter->filter() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CmsPageController->filterAccessControl() +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter() +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CmsPageController->runActionWithFilters() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CmsPageController->run() +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController() +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CWebApplication->run() +REQUEST_URI=/index.php?r=cmsPage/create +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php (72) +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php (13) +2012/04/15 17:54:06 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The requested page does not exist.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php:160 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(54): CmsPageController->loadModel('9') +#1 [internal function]: CmsPageController->actionView('9') +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#16 {main} +REQUEST_URI=/index.php?r=cmsPage/view&id=9 +HTTP_REFERER=http://localhost/index.php?r=cmsPage/create +--- +2012/04/15 17:54:18 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The requested page does not exist.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php:160 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(54): CmsPageController->loadModel('9') +#1 [internal function]: CmsPageController->actionView('9') +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#16 {main} +REQUEST_URI=/index.php?r=cmsPage/view&id=9 +HTTP_REFERER=http://localhost/index.php?r=cmsPage/create +--- +2012/04/15 17:54:38 [error] [exception.CHttpException.400] exception 'CHttpException' with message 'Your request is invalid.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php:337 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(310): CController->invalidActionParams(Object(CInlineAction)) +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#12 {main} +REQUEST_URI=/index.php?r=cmsPage/view&slug=Slug +--- +2012/04/15 18:08:47 [error] [exception.CHttpException.400] exception 'CHttpException' with message 'Your request is invalid.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php:337 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(310): CController->invalidActionParams(Object(CInlineAction)) +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#12 {main} +REQUEST_URI=/index.php?r=cmsPage/view&slug=Slug +--- +2012/04/15 18:08:54 [error] [exception.CException] exception 'CException' with message 'Property "CmsPageController.content" is not defined.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\views\cmsPage\view.php(21): CComponent->__get('content') +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CBaseController.php(127): require('D:\Priv\CCWN\As...') +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Priv\CCWN\As...', Array, true) +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(870): CBaseController->renderFile('D:\Priv\CCWN\As...', Array, true) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(783): CController->renderPartial('view', Array, true) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(55): CController->render('view', Array) +#6 [internal function]: CmsPageController->actionView('1') +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#16 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#17 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#18 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#19 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#20 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#21 {main} +REQUEST_URI=/index.php?r=cmsPage/view&id=1 +--- +2012/04/15 18:10:36 [error] [exception.CException] exception 'CException' with message 'Property "CmsPage.update" is not defined.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(144): CComponent->__get('update') +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\views\cmsPage\view.php(38): CActiveRecord->__get('update') +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CBaseController.php(127): require('D:\Priv\CCWN\As...') +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Priv\CCWN\As...', Array, true) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(870): CBaseController->renderFile('D:\Priv\CCWN\As...', Array, true) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(783): CController->renderPartial('view', Array, true) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(55): CController->render('view', Array) +#7 [internal function]: CmsPageController->actionView('1') +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#16 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#17 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#18 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#19 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#20 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#21 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#22 {main} +REQUEST_URI=/index.php?r=cmsPage/view&id=1 +--- diff --git a/protected/runtime/gii-1.1.10/CrudCode.php b/protected/runtime/gii-1.1.10/CrudCode.php new file mode 100644 index 0000000..20e6de0 --- /dev/null +++ b/protected/runtime/gii-1.1.10/CrudCode.php @@ -0,0 +1,5 @@ +<?php +return array ( + 'template' => 'default', + 'baseControllerClass' => 'Controller', +); diff --git a/protected/runtime/gii-1.1.10/ModelCode.php b/protected/runtime/gii-1.1.10/ModelCode.php new file mode 100644 index 0000000..5e9791a --- /dev/null +++ b/protected/runtime/gii-1.1.10/ModelCode.php @@ -0,0 +1,8 @@ +<?php +return array ( + 'template' => 'default', + 'tablePrefix' => 'tbl_', + 'modelPath' => 'application.models', + 'baseClass' => 'CActiveRecord', + 'buildRelations' => '1', +); diff --git a/protected/views/cmsPage/_form.php b/protected/views/cmsPage/_form.php new file mode 100644 index 0000000..4b29cd3 --- /dev/null +++ b/protected/views/cmsPage/_form.php @@ -0,0 +1,50 @@ +<div class="form"> + +<?php $form=$this->beginWidget('CActiveForm', array( + 'id'=>'cms-page-form', + 'enableAjaxValidation'=>false, +)); ?> + + <p class="note">Fields with <span class="required">*</span> are required.</p> + + <?php echo $form->errorSummary($model); ?> + + <div class="row"> + + <?php echo $form->labelEx($model,'content'); ?> + <?php $this->widget( + 'application.extensions.ddeditor.DDEditor', + array( + 'model'=>$model, + 'attribute'=>'content', + 'htmlOptions'=>array('rows'=>10, 'cols'=>70), + 'previewRequest'=>'cmsPage/preview')); ?> + <?php echo $form->error($model,'content'); ?> + </div> + + <div class="row"> + <?php echo $form->labelEx($model,'title'); ?> + <?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?> + <?php echo $form->error($model,'title'); ?> + </div> + + + <div class="row"> + <?php echo $form->labelEx($model,'status'); ?> + <?php echo $form->textField($model,'status'); ?> + <?php echo $form->error($model,'status'); ?> + </div> + + <div class="row"> + <?php echo $form->labelEx($model,'slug'); ?> + <?php echo $form->textField($model,'slug',array('size'=>60,'maxlength'=>255)); ?> + <?php echo $form->error($model,'slug'); ?> + </div> + + <div class="row buttons"> + <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?> + </div> + +<?php $this->endWidget(); ?> + +</div><!-- form -->
\ No newline at end of file diff --git a/protected/views/cmsPage/_search.php b/protected/views/cmsPage/_search.php new file mode 100644 index 0000000..abab43c --- /dev/null +++ b/protected/views/cmsPage/_search.php @@ -0,0 +1,49 @@ +<div class="wide form"> + +<?php $form=$this->beginWidget('CActiveForm', array( + 'action'=>Yii::app()->createUrl($this->route), + 'method'=>'get', +)); ?> + + <div class="row"> + <?php echo $form->label($model,'id'); ?> + <?php echo $form->textField($model,'id'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'content'); ?> + <?php echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50)); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'title'); ?> + <?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'create_time'); ?> + <?php echo $form->textField($model,'create_time'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'update_time'); ?> + <?php echo $form->textField($model,'update_time'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'status'); ?> + <?php echo $form->textField($model,'status'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'slug'); ?> + <?php echo $form->textField($model,'slug',array('size'=>60,'maxlength'=>255)); ?> + </div> + + <div class="row buttons"> + <?php echo CHtml::submitButton('Search'); ?> + </div> + +<?php $this->endWidget(); ?> + +</div><!-- search-form -->
\ No newline at end of file diff --git a/protected/views/cmsPage/_view.php b/protected/views/cmsPage/_view.php new file mode 100644 index 0000000..fd490a3 --- /dev/null +++ b/protected/views/cmsPage/_view.php @@ -0,0 +1,32 @@ +<div class="view"> + + <b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b> + <?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('content')); ?>:</b> + <?php echo CHtml::encode($data->content); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('title')); ?>:</b> + <?php echo CHtml::encode($data->title); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('create_time')); ?>:</b> + <?php echo CHtml::encode($data->create_time); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('update_time')); ?>:</b> + <?php echo CHtml::encode($data->update_time); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('status')); ?>:</b> + <?php echo CHtml::encode($data->status); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('slug')); ?>:</b> + <?php echo CHtml::encode($data->slug); ?> + <br /> + + +</div>
\ No newline at end of file diff --git a/protected/views/cmsPage/admin.php b/protected/views/cmsPage/admin.php new file mode 100644 index 0000000..88ede5c --- /dev/null +++ b/protected/views/cmsPage/admin.php @@ -0,0 +1,58 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages'=>array('index'), + 'Manage', +); + +$this->menu=array( + array('label'=>'List CmsPage', 'url'=>array('index')), + array('label'=>'Create CmsPage', 'url'=>array('create')), +); + +Yii::app()->clientScript->registerScript('search', " +$('.search-button').click(function(){ + $('.search-form').toggle(); + return false; +}); +$('.search-form form').submit(function(){ + $.fn.yiiGridView.update('cms-page-grid', { + data: $(this).serialize() + }); + return false; +}); +"); +?> + +<h1>Manage Cms Pages</h1> + +<p> +You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b> +or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done. +</p> + +<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?> +<div class="search-form" style="display:none"> +<?php $this->renderPartial('_search',array( + 'model'=>$model, +)); ?> +</div><!-- search-form --> + +<?php $this->widget('zii.widgets.grid.CGridView', array( + 'id'=>'cms-page-grid', + 'dataProvider'=>$model->search(), + 'filter'=>$model, + 'columns'=>array( + 'id', + 'content', + 'title', + 'create_time', + 'update_time', + 'status', + /* + 'slug', + */ + array( + 'class'=>'CButtonColumn', + ), + ), +)); ?> diff --git a/protected/views/cmsPage/create.php b/protected/views/cmsPage/create.php new file mode 100644 index 0000000..a193bdc --- /dev/null +++ b/protected/views/cmsPage/create.php @@ -0,0 +1,15 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages'=>array('index'), + 'Create', +); + +$this->menu=array( + array('label'=>'List CmsPage', 'url'=>array('index')), + array('label'=>'Manage CmsPage', 'url'=>array('admin')), +); +?> + +<h1>Create CmsPage</h1> + +<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
\ No newline at end of file diff --git a/protected/views/cmsPage/index.php b/protected/views/cmsPage/index.php new file mode 100644 index 0000000..2b9d12d --- /dev/null +++ b/protected/views/cmsPage/index.php @@ -0,0 +1,17 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages', +); + +$this->menu=array( + array('label'=>'Create CmsPage', 'url'=>array('create')), + array('label'=>'Manage CmsPage', 'url'=>array('admin')), +); +?> + +<h1>Cms Pages</h1> + +<?php $this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$dataProvider, + 'itemView'=>'_view', +)); ?> diff --git a/protected/views/cmsPage/update.php b/protected/views/cmsPage/update.php new file mode 100644 index 0000000..e4aa403 --- /dev/null +++ b/protected/views/cmsPage/update.php @@ -0,0 +1,18 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages'=>array('index'), + $model->title=>array('view','id'=>$model->id), + 'Update', +); + +$this->menu=array( + array('label'=>'List CmsPage', 'url'=>array('index')), + array('label'=>'Create CmsPage', 'url'=>array('create')), + array('label'=>'View CmsPage', 'url'=>array('view', 'id'=>$model->id)), + array('label'=>'Manage CmsPage', 'url'=>array('admin')), +); +?> + +<h1>Update CmsPage <?php echo $model->id; ?></h1> + +<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
\ No newline at end of file diff --git a/protected/views/cmsPage/view.php b/protected/views/cmsPage/view.php new file mode 100644 index 0000000..b05fd2e --- /dev/null +++ b/protected/views/cmsPage/view.php @@ -0,0 +1,39 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages'=>array('index'), + $model->title, +); + +$this->menu=array( + array('label'=>'List CmsPage', 'url'=>array('index')), + array('label'=>'Create CmsPage', 'url'=>array('create')), + array('label'=>'Update CmsPage', 'url'=>array('update', 'id'=>$model->id)), + array('label'=>'Delete CmsPage', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')), + array('label'=>'Manage CmsPage', 'url'=>array('admin')), +); +?> + +<h1><?php echo $model->title; ?></h1> + +<div> +<?php + $parser=new CMarkdownParser; + echo $parser->safeTransform($model->content); + +?> +</div> + +<?php $this->widget('zii.widgets.CDetailView', array( + 'data'=>$model, + 'attributes'=>array( + 'id', + 'content', + 'title', + 'create_time', + 'update_time', + 'status', + 'slug', + ), +)); ?> + +<div>Diese Seite wurde am <?php echo $model->update_time ?> zuletzt aktualisiert.</div>
\ No newline at end of file |
