diff --git a/engine/classes/ActionPlugin.class.php b/engine/classes/ActionPlugin.class.php index ddcb8f7a..0ed39448 100644 --- a/engine/classes/ActionPlugin.class.php +++ b/engine/classes/ActionPlugin.class.php @@ -37,6 +37,7 @@ abstract class ActionPlugin extends Action { public function __construct(Engine $oEngine, $sAction) { parent::__construct($oEngine, $sAction); $this->Viewer_Assign('sTemplatePathPlugin',rtrim($this->getTemplatePathPlugin(),'/')); + $this->Viewer_Assign('sTemplateWebPathPlugin',Plugin::GetTemplateWebPath(get_class($this))); } /** diff --git a/plugins/page/plugin.xml b/plugins/page/plugin.xml index e0274a78..cb56c6f7 100644 --- a/plugins/page/plugin.xml +++ b/plugins/page/plugin.xml @@ -7,7 +7,7 @@ LiveStreet Developers Team http://livestreet.ru - 1.0.1 + 1.0.2 0.4.1 diff --git a/plugins/page/templates/skin/developer/actions/ActionPage/add.tpl b/plugins/page/templates/skin/developer/actions/ActionPage/add.tpl new file mode 100644 index 00000000..23201340 --- /dev/null +++ b/plugins/page/templates/skin/developer/actions/ActionPage/add.tpl @@ -0,0 +1,91 @@ +{include file='window_load_img.tpl' sToLoad='page_text'} + + + + +{if $oConfig->GetValue('view.tinymce')} + + {literal} + + {/literal} +{/if} + + +
+ + +


+

+ + +


+

+ + +


+

+ + + + {if !$oConfig->GetValue('view.tinymce')} +
+ + + + +   + + + + + + +
+ {/if} +

+ +


+ + {$aLang.page_create_seo_keywords_notice}

+ +


+ + {$aLang.page_create_seo_description_notice}

+ +

+ +

+ + +

+ + +
\ No newline at end of file diff --git a/plugins/page/templates/skin/developer/actions/ActionPage/admin.tpl b/plugins/page/templates/skin/developer/actions/ActionPage/admin.tpl new file mode 100644 index 00000000..2c95aa8d --- /dev/null +++ b/plugins/page/templates/skin/developer/actions/ActionPage/admin.tpl @@ -0,0 +1,59 @@ +{include file='header.tpl'} + + + + +
+

{$aLang.page_admin}

+ + + {if $aParams.0=='new'} +

{$aLang.page_create}

+ {include file="$sTemplatePathPlugin/actions/ActionPage/add.tpl"} + {elseif $aParams.0=='edit'} +

{$aLang.page_edit} «{$oPageEdit->getTitle()}»

+ {include file="$sTemplatePathPlugin/actions/ActionPage/add.tpl"} + {else} + {$aLang.page_new}

+ {/if} + + + + + + + + + + + + + + {foreach from=$aPages item=oPage name=el2} + + + + + + + {/foreach} + +
{$aLang.page_admin_title}{$aLang.page_admin_url}{$aLang.page_admin_active}{$aLang.page_admin_action}
+ + {$oPage->getTitle()} + + /{$oPage->getUrlFull()}/ + + {if $oPage->getActive()} + {$aLang.page_admin_active_yes} + {else} + {$aLang.page_admin_active_no} + {/if} + + {$aLang.page_admin_action_edit} + {$aLang.page_admin_action_delete} +
+
+ + +{include file='footer.tpl'} \ No newline at end of file diff --git a/plugins/page/templates/skin/developer/actions/ActionPage/page.tpl b/plugins/page/templates/skin/developer/actions/ActionPage/page.tpl new file mode 100644 index 00000000..082769a5 --- /dev/null +++ b/plugins/page/templates/skin/developer/actions/ActionPage/page.tpl @@ -0,0 +1,14 @@ +{assign var="noSidebar" value=true} +{include file='header.tpl'} + +
+
+ {if $oConfig->GetValue('view.tinymce')} + {$oPage->getText()} + {else} + {$oPage->getText()|nl2br} + {/if} +
+
+ +{include file='footer.tpl'} \ No newline at end of file diff --git a/plugins/page/templates/skin/developer/css/style.css b/plugins/page/templates/skin/developer/css/style.css new file mode 100644 index 00000000..2221a2bb --- /dev/null +++ b/plugins/page/templates/skin/developer/css/style.css @@ -0,0 +1,4 @@ +.table a { color: #333; } +.table a:hover { color: #666; } + +.page-new { padding-left: 13px; background: url(../images/document.gif) no-repeat 0 3px; color: #555; } \ No newline at end of file diff --git a/plugins/page/templates/skin/developer/images/document.gif b/plugins/page/templates/skin/developer/images/document.gif new file mode 100644 index 00000000..b73f1a97 Binary files /dev/null and b/plugins/page/templates/skin/developer/images/document.gif differ diff --git a/plugins/page/templates/skin/developer/images/folder.gif b/plugins/page/templates/skin/developer/images/folder.gif new file mode 100644 index 00000000..45948a0c Binary files /dev/null and b/plugins/page/templates/skin/developer/images/folder.gif differ diff --git a/plugins/profiler/plugin.xml b/plugins/profiler/plugin.xml index 8e9f2db8..9cf72969 100644 --- a/plugins/profiler/plugin.xml +++ b/plugins/profiler/plugin.xml @@ -7,7 +7,7 @@ LiveStreet Developers Team http://livestreet.ru/ - 1.0.0 + 1.0.1 0.4.1 diff --git a/plugins/profiler/templates/skin/developer/actions/ActionProfiler/ajax/level.tpl b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/ajax/level.tpl new file mode 100644 index 00000000..b356c7c6 --- /dev/null +++ b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/ajax/level.tpl @@ -0,0 +1,14 @@ +
+ + {foreach from=$oReport->getAllEntries() item=oEntry} + + + + + + + + + {/foreach} +
{if $oEntry->getChildCount()!=0}+{/if}{$oEntry->getId()}{$oEntry->getName()}{$oEntry->getTimeFull()}{$oReport->getEntryFullShare($oEntry->getId())}% ({$oReport->getEntryShare($oEntry->getId())}%){$oEntry->getComment()}
+
\ No newline at end of file diff --git a/plugins/profiler/templates/skin/developer/actions/ActionProfiler/ajax/report.tpl b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/ajax/report.tpl new file mode 100644 index 00000000..d3f2f639 --- /dev/null +++ b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/ajax/report.tpl @@ -0,0 +1,22 @@ +{if $oReport} + {$aLang.profiler_entries_show_tree} + {$aLang.profiler_entries_show_all} ({$oReport->getStat('count')}) + {$aLang.profiler_entries_show_query} ({$oReport->getStat('query')}) + +
+ + {foreach from=$oReport->getAllEntries() item=oEntry} + + + + + + + + + {/foreach} +
{$oEntry->getId()}{$oEntry->getName()}{$oEntry->getTimeFull()}{$oReport->getEntryFullShare($oEntry->getId())}% ({$oReport->getEntryShare($oEntry->getId())}%){$oEntry->getComment()}
+
+{else} + {$aLang.error} +{/if} \ No newline at end of file diff --git a/plugins/profiler/templates/skin/developer/actions/ActionProfiler/ajax/tree.tpl b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/ajax/tree.tpl new file mode 100644 index 00000000..1f69ef25 --- /dev/null +++ b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/ajax/tree.tpl @@ -0,0 +1,9 @@ +{if $oReport} + {$aLang.profiler_entries_show_tree} + {$aLang.profiler_entries_show_all} ({$oReport->getStat('count')}) + {$aLang.profiler_entries_show_query} ({$oReport->getStat('query')}) + + {include file='profiler/templates/skin/developer/actions/ActionProfiler/ajax/level.tpl'} +{else} + {$aLang.error} +{/if} \ No newline at end of file diff --git a/plugins/profiler/templates/skin/developer/actions/ActionProfiler/report.tpl b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/report.tpl new file mode 100644 index 00000000..0cb0a912 --- /dev/null +++ b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/report.tpl @@ -0,0 +1,46 @@ +{include file='header.tpl' noShowSystemMessage=false} + + + + + + + + +

{$aLang.profiler_reports_title}

+ +
+ + + + + + + + + + + + + + + {foreach from=$aReports item=oReport} + + + + + + + + {/foreach} + +
{$aLang.profiler_table_date}{$aLang.profiler_table_time_full}{$aLang.profiler_table_count_id}
+{date_format date=$oReport.request_date}{$oReport.time_full}{$oReport.count_time_id}
+ + +
+ + +{include file='pagination.tpl' aPaging="$aPaging"} +{include file='footer.tpl'} \ No newline at end of file diff --git a/plugins/profiler/templates/skin/developer/actions/ActionProfiler/sidebar.tpl b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/sidebar.tpl new file mode 100644 index 00000000..0741d865 --- /dev/null +++ b/plugins/profiler/templates/skin/developer/actions/ActionProfiler/sidebar.tpl @@ -0,0 +1,89 @@ +
+
+ {$aLang.profiler_filter_highlight} ({$aLang.profiler_filter_seconds}):
+ +
+
+ +
+

{$aLang.profiler_dbstat_title}

+ +
+

{$aLang.profiler_dbstat_count}: {$aDatabaseStat.count}
+ {$aLang.profiler_dbstat_max_date}: {$aDatabaseStat.max_date}

+ +


+
+ {$aLang.profiler_import_notice}

+ + +
+
+ + +
+

{$aLang.profiler_filter_title}

+ + {literal} + + {/literal} + + +
+


+ — +
+ {$aLang.profiler_filter_notice_date}

+ +


+
+ {$aLang.profiler_filter_notice_time}

+ +


+

+ + +
+ + +
\ No newline at end of file diff --git a/plugins/profiler/templates/skin/developer/css/style.css b/plugins/profiler/templates/skin/developer/css/style.css new file mode 100644 index 00000000..eebf0d0d --- /dev/null +++ b/plugins/profiler/templates/skin/developer/css/style.css @@ -0,0 +1 @@ +a.profiler { margin: 2px; padding: 4px 5px; text-decoration: none; } a.profiler.active { background: #333; color: #fff; } .profiler.entries { margin-top: 5px; } .profiler-table .has-child { background: #f4f4f4; } .profiler-table .filter { background: #dafad8; } .profiler-highlight { color: #4bb23b; } \ No newline at end of file diff --git a/plugins/profiler/templates/skin/developer/images/close.gif b/plugins/profiler/templates/skin/developer/images/close.gif new file mode 100644 index 00000000..fe57e389 Binary files /dev/null and b/plugins/profiler/templates/skin/developer/images/close.gif differ diff --git a/plugins/profiler/templates/skin/developer/images/open.gif b/plugins/profiler/templates/skin/developer/images/open.gif new file mode 100644 index 00000000..9fe9fc61 Binary files /dev/null and b/plugins/profiler/templates/skin/developer/images/open.gif differ diff --git a/plugins/profiler/templates/skin/developer/js/profiler.js b/plugins/profiler/templates/skin/developer/js/profiler.js new file mode 100644 index 00000000..9826d5ee --- /dev/null +++ b/plugins/profiler/templates/skin/developer/js/profiler.js @@ -0,0 +1,207 @@ +var lsProfilerClass = new Class({ + + Implements: Options, + + options: { + img : { + path: DIR_PLUGIN_SKIN+'/images/', + openName: 'open.gif', + closeName: 'close.gif' + }, + classes: { + visible: 'lsProfiler_visible', + hidden: 'lsProfiler_hidden', + openImg: 'lsProfiler_open', + closeImg: 'lsProfiler_close', + treeNode: 'lsProfiler_tree', + filterNode: 'lsProfiler_filter' + }, + prefix: { + img: 'img_', + td: 'report_', + entry: 'entry_', + tree: 'tree_', + treeNode: 'tree_node_' + }, + path: { + loadReport: aRouter['profiler']+'ajaxloadreport/', + loadEntries: aRouter['profiler']+'ajaxloadentriesbyfilter/' + } + }, + + initialize: function(options){ + this.setOptions(options); + this.make(); + }, + + make: function(expandClass){ + var thisObj = this; + var aImgFolding=(!expandClass)?$$('img.folding'):$$('img.folding.'+expandClass); + aImgFolding.each(function(img, i){thisObj.makeImg(img);}); + }, + + makeImg: function(img) { + var thisObj = this; + img.setStyles({ + 'cursor' : 'pointer', + 'display' : 'inline' + }); + img.removeClass(this.options.classes.closeImg); + img.addClass(this.options.classes.openImg); + img.removeEvents('click'); + img.addEvent('click',function(){ + thisObj.toggleNode(img); + }); + }, + + toggleNode: function(img) { + if (img.hasClass(this.options.classes.closeImg)) { + this.collapseNode(img); + } else { + this.expandNode(img); + } + }, + + expandNode: function(img) { + var thisObj = this; + + img.setProperties({'src': this.options.img.path + this.options.img.closeName}); + img.removeClass(this.options.classes.openImg); + img.addClass(this.options.classes.closeImg); + + if(img.hasClass(thisObj.options.classes.treeNode)) { + // Это элемент дерева - обрабатываем его соответствующим образом + ids = img.get('id').replace(this.options.prefix.tree,'').split('_'); + + reportId=ids[0]; + var trReportId=this.options.prefix.treeNode+ids[0]+'_'+ids[1]; + var trReport=$(trReportId); + var parentId=ids[1]; + } else { + reportId=img.get('id').replace(this.options.prefix.img,this.options.prefix.td); + var trReport = $(reportId); + var parentId = 0; + var trReportId = 0; + } + + if(trReport){ + trReport.show(); + } else { + thisObj.loadReport(img.getParent('tr'),reportId,parentId,trReportId); + } + }, + + loadReport: function(obj,reportId,parentId,namedId) { + var thisObj=this; + var trCurrent = obj; + + JsHttpRequest.query( + 'POST '+thisObj.options.path.loadReport, + { + reportId: reportId, + bTreeView: true, + parentId: parentId, + security_ls_key: LIVESTREET_SECURITY_KEY + }, + function(result, errors) { + if (!result) { + msgErrorBox.alert('Error','Please try again later'); + } + if (result.bStateError) { + msgErrorBox.alert(result.sMsgTitle,result.sMsg); + } else { + var trReport=new Element('tr', {'id':(!namedId)?reportId:namedId}); + trReport.adopt(new Element('td',{ + 'colspan': 6, + 'html' : result.sReportText + })); + trReport.inject(trCurrent,'after'); + trReport.getElements('img').each(function(img, i){thisObj.makeImg(img);}); + } + }, + true + ); + }, + + collapseNode: function(img) { + var thisObj = this; + + img.setProperties({'src': this.options.img.path + this.options.img.openName}); + img.removeClass(this.options.classes.closeImg); + img.addClass(this.options.classes.openImg); + + if(img.hasClass(thisObj.options.classes.treeNode)) { + // Это элемент дерева - обрабатываем его соответствующим образом + trReport=img.getParent('tr').getNext('tr'); + } else { + reportId=img.get('id').replace(this.options.prefix.img,this.options.prefix.td); + var trReport = $(reportId); + } + + trReport.hide(); + }, + + toggleEntriesByClass: function(reportId,name,link) { + var thisObj=this; + $$('a.profiler').removeClass('active'); + $$('a.profiler.'+name).addClass('active'); + + //var trCurrent = link.getParent('tr').getPrevious('tr'); + + JsHttpRequest.query( + 'POST '+thisObj.options.path.loadEntries+name+'/', + { + reportId: reportId, + security_ls_key: LIVESTREET_SECURITY_KEY + }, + function(result, errors) { + if (!result) { + msgErrorBox.alert('Error','Please try again later'); + } + if (result.bStateError) { + msgErrorBox.alert(result.sMsgTitle,result.sMsg); + } else { + var trReport = $(thisObj.options.prefix.td+reportId).empty(); + trReport.adopt(new Element('td',{ + 'colspan': 5, + 'html' : result.sReportText + })); + trReport.getElements('img').each(function(img, i){thisObj.makeImg(img);}); + } + }, + true + ); + }, + + filterNode: function(obj) { + var thisObj = this; + var iTime=obj.get('value'); + if(iTime!='' && parseFloat(iTime)){ thisObj.highlightFilterNode(iTime); } + }, + + highlightFilterNode: function(iTime) { + var thisObj = this; + + $$('.time').each(function(el,i){ + el.getParent('tr').removeClass(thisObj.options.classes.filterNode); + if(el.get('text')>iTime) { + el.getParent('tr').addClass(thisObj.options.classes.filterNode); + } + }); + } +}); + +var lsProfiler; + +window.addEvent('domready', function() { + lsProfiler = new lsProfilerClass({ + img: { + path: DIR_PLUGIN_SKIN+'/images/' + }, + classes: { + openImg: 'folding-open', + closeImg: 'folding', + filterNode: 'filter' + } + }); +}); \ No newline at end of file