mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-26 03:30:48 +03:00
Система плагинов: запуск модулей из плагина, создание сущности из модуля плагина, определение шаблонов плагина.
This commit is contained in:
parent
56790bb539
commit
d0dd89e5e9
|
@ -76,7 +76,7 @@ class ActionProfiler extends Action {
|
|||
|
||||
$aReportsId=getRequest('report_del');
|
||||
if (is_array($aReportsId)) {
|
||||
if($this->Profiler_DeleteEntryByRequestId(array_keys($aReportsId))) {
|
||||
if($this->PluginProfiler_Profiler_DeleteEntryByRequestId(array_keys($aReportsId))) {
|
||||
$this->Message_AddNotice($this->Lang_Get('profiler_report_delete_success'), $this->Lang_Get('attention'));
|
||||
} else {
|
||||
$this->Message_AddError($this->Lang_Get('profiler_report_delete_error'), $this->Lang_Get('error'));
|
||||
|
@ -88,7 +88,7 @@ class ActionProfiler extends Action {
|
|||
* Если вызвана обработка upload`а логов в базу данных
|
||||
*/
|
||||
if(getRequest('submit_profiler_import') and getRequest('profiler_date_import')) {
|
||||
$iCount = @$this->Profiler_UploadLog(date('Y-m-d H:i:s',strtotime(getRequest('profiler_date_import'))));
|
||||
$iCount = @$this->PluginProfiler_Profiler_UploadLog(date('Y-m-d H:i:s',strtotime(getRequest('profiler_date_import'))));
|
||||
if(!is_null($iCount)) {
|
||||
$this->Message_AddNotice($this->Lang_Get('profiler_import_report_success',array('count'=>$iCount)), $this->Lang_Get('attention'));
|
||||
} else {
|
||||
|
@ -108,7 +108,7 @@ class ActionProfiler extends Action {
|
|||
/**
|
||||
* Получаем список отчетов
|
||||
*/
|
||||
$aResult=$this->Profiler_GetReportsByFilter($aFilter,$iPage,Config::Get('module.profiler.per_page'));
|
||||
$aResult=$this->PluginProfiler_Profiler_GetReportsByFilter($aFilter,$iPage,Config::Get('module.profiler.per_page'));
|
||||
$aReports=$aResult['collection'];
|
||||
/**
|
||||
* Если был использован фильтр, выводим количество найденых по фильтру
|
||||
|
@ -137,7 +137,7 @@ class ActionProfiler extends Action {
|
|||
*/
|
||||
$this->Viewer_Assign('aPaging',$aPaging);
|
||||
$this->Viewer_Assign('aReports',$aReports);
|
||||
$this->Viewer_Assign('aDatabaseStat',($aData=$this->Profiler_GetDatabaseStat())?$aData:array('max_date'=>'','count'=>''));
|
||||
$this->Viewer_Assign('aDatabaseStat',($aData=$this->PluginProfiler_Profiler_GetDatabaseStat())?$aData:array('max_date'=>'','count'=>''));
|
||||
$this->Viewer_AddBlock('right','actions/ActionProfiler/sidebar.tpl');
|
||||
$this->Viewer_AddHtmlTitle($this->Lang_Get('profiler_report_page_title'));
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ class ActionProfiler extends Action {
|
|||
$sParentId=getRequest('parentId',null,'post');
|
||||
|
||||
$oViewerLocal=$this->Viewer_GetLocalViewer();
|
||||
$oViewerLocal->Assign('oReport',$this->Profiler_GetReportById($sReportId,$sParentId));
|
||||
$oViewerLocal->Assign('oReport',$this->PluginProfiler_Profiler_GetReportById($sReportId,$sParentId));
|
||||
if(!$sParentId) $oViewerLocal->Assign('sAction','tree');
|
||||
|
||||
$sTemplateName = ($bTreeView)
|
||||
|
@ -240,7 +240,7 @@ class ActionProfiler extends Action {
|
|||
$oViewerLocal=$this->Viewer_GetLocalViewer();
|
||||
$oViewerLocal->Assign('sAction',$sAction);
|
||||
|
||||
$oReport = $this->Profiler_GetReportById($sReportId,($sAction=='tree')?0:null);
|
||||
$oReport = $this->PluginProfiler_Profiler_GetReportById($sReportId,($sAction=='tree')?0:null);
|
||||
|
||||
/**
|
||||
* Преобразуем report взависимости от выбранного фильтра
|
||||
|
|
|
@ -76,7 +76,7 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
|
||||
$aReportsId=getRequest('report_del');
|
||||
if (is_array($aReportsId)) {
|
||||
if($this->Profiler_DeleteEntryByRequestId(array_keys($aReportsId))) {
|
||||
if($this->PluginProfiler_Profiler_DeleteEntryByRequestId(array_keys($aReportsId))) {
|
||||
$this->Message_AddNotice($this->Lang_Get('profiler_report_delete_success'), $this->Lang_Get('attention'));
|
||||
} else {
|
||||
$this->Message_AddError($this->Lang_Get('profiler_report_delete_error'), $this->Lang_Get('error'));
|
||||
|
@ -88,7 +88,7 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
* Если вызвана обработка upload`а логов в базу данных
|
||||
*/
|
||||
if(getRequest('submit_profiler_import') and getRequest('profiler_date_import')) {
|
||||
$iCount = @$this->Profiler_UploadLog(date('Y-m-d H:i:s',strtotime(getRequest('profiler_date_import'))));
|
||||
$iCount = @$this->PluginProfiler_Profiler_UploadLog(date('Y-m-d H:i:s',strtotime(getRequest('profiler_date_import'))));
|
||||
if(!is_null($iCount)) {
|
||||
$this->Message_AddNotice($this->Lang_Get('profiler_import_report_success',array('count'=>$iCount)), $this->Lang_Get('attention'));
|
||||
} else {
|
||||
|
@ -108,7 +108,7 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
/**
|
||||
* Получаем список отчетов
|
||||
*/
|
||||
$aResult=$this->Profiler_GetReportsByFilter($aFilter,$iPage,Config::Get('module.profiler.per_page'));
|
||||
$aResult=$this->PluginProfiler_Profiler_GetReportsByFilter($aFilter,$iPage,Config::Get('module.profiler.per_page'));
|
||||
$aReports=$aResult['collection'];
|
||||
/**
|
||||
* Если был использован фильтр, выводим количество найденых по фильтру
|
||||
|
@ -124,7 +124,7 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging(
|
||||
$aResult['count'],$iPage,Config::Get('module.profiler.per_page'),4,
|
||||
$aResult['count'],$iPage,Config::Get('plugin.profiler.per_page'),4,
|
||||
Router::GetPath('profiler').$this->sCurrentEvent,
|
||||
array_intersect_key(
|
||||
$_REQUEST,
|
||||
|
@ -137,8 +137,8 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
*/
|
||||
$this->Viewer_Assign('aPaging',$aPaging);
|
||||
$this->Viewer_Assign('aReports',$aReports);
|
||||
$this->Viewer_Assign('aDatabaseStat',($aData=$this->Profiler_GetDatabaseStat())?$aData:array('max_date'=>'','count'=>''));
|
||||
$this->Viewer_AddBlock('right','actions/ActionProfiler/sidebar.tpl');
|
||||
$this->Viewer_Assign('aDatabaseStat',($aData=$this->PluginProfiler_Profiler_GetDatabaseStat())?$aData:array('max_date'=>'','count'=>''));
|
||||
$this->Viewer_AddBlock('right','plugins/profiler/actions/ActionProfiler/sidebar.tpl');
|
||||
$this->Viewer_AddHtmlTitle($this->Lang_Get('profiler_report_page_title'));
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
}
|
||||
|
||||
if($iPerPage=getRequest('per_page',0) and $iPerPage>0) {
|
||||
Config::Set('module.profiler.per_page',$iPerPage);
|
||||
Config::Set('plugins.profiler.per_page',$iPerPage);
|
||||
}
|
||||
return $aFilter;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
$sParentId=getRequest('parentId',null,'post');
|
||||
|
||||
$oViewerLocal=$this->Viewer_GetLocalViewer();
|
||||
$oViewerLocal->Assign('oReport',$this->Profiler_GetReportById($sReportId,$sParentId));
|
||||
$oViewerLocal->Assign('oReport',$this->PluginProfiler_Profiler_GetReportById($sReportId,$sParentId));
|
||||
if(!$sParentId) $oViewerLocal->Assign('sAction','tree');
|
||||
|
||||
$sTemplateName = ($bTreeView)
|
||||
|
@ -223,7 +223,7 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
? 'level'
|
||||
: 'tree')
|
||||
:'report';
|
||||
$this->Viewer_AssignAjax('sReportText',$oViewerLocal->Fetch("actions/ActionProfiler/ajax/{$sTemplateName}.tpl"));
|
||||
$this->Viewer_AssignAjax('sReportText',$oViewerLocal->Fetch("plugins/profiler/actions/ActionProfiler/ajax/{$sTemplateName}.tpl"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -240,7 +240,7 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
$oViewerLocal=$this->Viewer_GetLocalViewer();
|
||||
$oViewerLocal->Assign('sAction',$sAction);
|
||||
|
||||
$oReport = $this->Profiler_GetReportById($sReportId,($sAction=='tree')?0:null);
|
||||
$oReport = $this->PluginProfiler_Profiler_GetReportById($sReportId,($sAction=='tree')?0:null);
|
||||
|
||||
/**
|
||||
* Преобразуем report взависимости от выбранного фильтра
|
||||
|
@ -253,7 +253,7 @@ class PluginProfiler_ActionProfiler extends Action {
|
|||
$oViewerLocal->Assign('oReport',$oReport);
|
||||
|
||||
$sTemplateName=($sAction=='tree')?'tree':'report';
|
||||
$this->Viewer_AssignAjax('sReportText',$oViewerLocal->Fetch("actions/ActionProfiler/ajax/{$sTemplateName}.tpl"));
|
||||
$this->Viewer_AssignAjax('sReportText',$oViewerLocal->Fetch("plugins/profiler/actions/ActionProfiler/ajax/{$sTemplateName}.tpl"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -53,10 +53,10 @@ class PluginProfiler_LsProfiler extends Module {
|
|||
/**
|
||||
* Добавить новую запись в базу данных
|
||||
*
|
||||
* @param ProfilerEntity_Entry $oEntry
|
||||
* @param PluginProfiler_ProfilerEntity_Entry $oEntry
|
||||
* @return bool
|
||||
*/
|
||||
public function AddEntry(ProfilerEntity_Entry $oEntry) {
|
||||
public function AddEntry(PluginProfiler_ProfilerEntity_Entry $oEntry) {
|
||||
return $this->oMapper->AddEntry($oEntry);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ class PluginProfiler_LsProfiler extends Module {
|
|||
* Читает из лог-файла записи
|
||||
*
|
||||
* @param string $sPath
|
||||
* @return ProfilerEntity_Entry
|
||||
* @return PluginProfiler_ProfilerEntity_Entry
|
||||
*/
|
||||
public function ReadEntry() {
|
||||
/**
|
||||
|
@ -84,7 +84,7 @@ class PluginProfiler_LsProfiler extends Module {
|
|||
$aTime['time_pid'],$aTime['time_name'],$aTime['time_comment']
|
||||
)=explode($this->sDataDelimiter,$sLine,9);
|
||||
|
||||
return Engine::GetEntity('Profiler_Entry',$aTime);
|
||||
return Engine::GetEntity('PluginProfiler_Profiler_Entry',$aTime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -169,7 +169,7 @@ class PluginProfiler_LsProfiler extends Module {
|
|||
'time_full' => 0
|
||||
);
|
||||
|
||||
$oReport = Engine::GetEntity('Profiler_Report');
|
||||
$oReport = Engine::GetEntity('PluginProfiler_Profiler_Report');
|
||||
$aEntries = $this->BuildEntriesRecursive($aReportRows);
|
||||
foreach ($aEntries as $oEntry) {
|
||||
$oReport->addEntry($oEntry);
|
||||
|
@ -227,7 +227,7 @@ class PluginProfiler_LsProfiler extends Module {
|
|||
$aTemp=$aEntry;
|
||||
$aTemp['level']=$iLevel;
|
||||
unset($aTemp['childNodes']);
|
||||
$aResultEntries[]=Engine::GetEntity('Profiler_Entry',$aTemp);
|
||||
$aResultEntries[]=Engine::GetEntity('PluginProfiler_Profiler_Entry',$aTemp);
|
||||
if (isset($aEntry['childNodes']) and count($aEntry['childNodes'])>0) {
|
||||
$iLevel++;
|
||||
$this->BuildEntriesRecursive($aEntry['childNodes'],false);
|
||||
|
|
|
@ -106,7 +106,7 @@ class PluginProfiler_ProfilerEntity_Report extends Entity
|
|||
$this->_aData['report_time_full']=$data;
|
||||
}
|
||||
|
||||
public function addEntry(ProfilerEntity_Entry $data) {
|
||||
public function addEntry(PluginProfiler_ProfilerEntity_Entry $data) {
|
||||
if(!isset($this->_aData['report_id'])) {
|
||||
$this->setId($data->getRequestId());
|
||||
$this->setDate($data->getDate());
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
class PluginProfiler_Mapper_Profiler extends Mapper {
|
||||
|
||||
public function AddEntry(ProfilerEntity_Entry $oEntry) {
|
||||
public function AddEntry(PluginProfiler_ProfilerEntity_Entry $oEntry) {
|
||||
$sql = "INSERT IGNORE INTO ".Config::Get('db.table.profiler')."
|
||||
(request_date,
|
||||
request_id,
|
||||
|
|
|
@ -224,7 +224,9 @@ abstract class Action extends Object {
|
|||
*/
|
||||
public function GetTemplate() {
|
||||
if (is_null($this->sActionTemplate)) {
|
||||
$this->sActionTemplate='actions/'.$this->GetActionClass().'/'.$this->sCurrentEvent.'.tpl';
|
||||
$this->sActionTemplate=preg_match('/^Plugin([\w]+)_Action([\w]+)$/i',$this->GetActionClass(),$aMatches)
|
||||
? 'plugins/'.strtolower($aMatches[1]).'/actions/Action'.ucfirst($aMatches[2]).'/'.$this->sCurrentEvent.'.tpl'
|
||||
: 'actions/'.$this->GetActionClass().'/'.$this->sCurrentEvent.'.tpl';
|
||||
}
|
||||
return $this->sActionTemplate;
|
||||
}
|
||||
|
|
|
@ -397,10 +397,29 @@ class Engine extends Object {
|
|||
* Сущности, имеющие такое же название как модуль,
|
||||
* можно вызывать сокращенно. Например, вместо User_User -> User
|
||||
*/
|
||||
if(substr_count($sName,'_')==0) {
|
||||
$sEntity = $sModule = $sName;
|
||||
} else {
|
||||
list($sModule,$sEntity) = explode('_',$sName,2);
|
||||
switch (substr_count($sName,'_')) {
|
||||
case 0:
|
||||
$sEntity = $sModule = $sName;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
list($sModule,$sEntity) = explode('_',$sName,2);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
/**
|
||||
* Entity плагина
|
||||
*/
|
||||
if(substr($sName,0,6)=='Plugin') {
|
||||
list($sPlugin,$sModule,$sEntity)=explode('_',$sName);
|
||||
$sPlugin = substr($sPlugin,6);
|
||||
} else {
|
||||
throw new Exception("Unknown entity '{$sName}' given.");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Exception("Unknown entity '{$sName}' given.");
|
||||
}
|
||||
/**
|
||||
* Проверяем наличие сущности в меппере кастомизации
|
||||
|
@ -411,8 +430,14 @@ class Engine extends Object {
|
|||
: $sEntity;
|
||||
//$sFileClass=Config::get('path.root.server').'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.'.((self::$aEntityCustoms[$sName]=='custom')?'custom.':'').'php';
|
||||
} else {
|
||||
$sFileDefaultClass=Config::get('path.root.server').'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.php';
|
||||
$sFileCustomClass = Config::get('path.root.server').'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.custom.php';
|
||||
$sFileDefaultClass=isset($sPlugin)
|
||||
? Config::get('path.root.server').'/classes/plugins/'.strtolower($sPlugin).'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.php'
|
||||
: Config::get('path.root.server').'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.php';
|
||||
|
||||
$sFileCustomClass=isset($sPlugin)
|
||||
? Config::get('path.root.server').'/classes/plugins/'.strtolower($sPlugin).'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.custom.php'
|
||||
: Config::get('path.root.server').'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.custom.php';
|
||||
|
||||
/**
|
||||
* Пытаемся найти кастомизированную сущность
|
||||
*/
|
||||
|
@ -430,10 +455,12 @@ class Engine extends Object {
|
|||
/**
|
||||
* Подгружаем нужный файл
|
||||
*/
|
||||
require_once($sFileClass);
|
||||
require_once($sFileClass);
|
||||
}
|
||||
|
||||
$sClass=$sModule.'Entity_'.$sEntity;
|
||||
$sClass=isset($sPlugin)
|
||||
? 'Plugin'.$sPlugin.'_'.$sModule.'Entity_'.$sEntity
|
||||
: $sModule.'Entity_'.$sEntity;
|
||||
$oEntity=new $sClass($aParams);
|
||||
return $oEntity;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ class LsLang extends Module {
|
|||
: array_merge($this->aLangMsg,include($sLangFilePath));
|
||||
}
|
||||
/**
|
||||
* Ищет конфиги языковых файлов и объединяет их с текущим
|
||||
* Ищет языковые файлы модулей и объединяет их с текущим
|
||||
*/
|
||||
$sDirConfig=$this->sLangPath.'/modules/';
|
||||
if ($hDirConfig = opendir($sDirConfig)) {
|
||||
|
@ -109,6 +109,26 @@ class LsLang extends Module {
|
|||
}
|
||||
closedir($hDirConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ищет языковые файлы актвиированных плагинов
|
||||
*/
|
||||
if($aPluginList = @file(Config::Get('path.root.server').'/classes/plugins/plugins.dat')) {
|
||||
$sDir=Config::Get('path.root.server').'/classes/plugins/';
|
||||
|
||||
foreach ($aPluginList as $sPluginName) {
|
||||
$aFiles=glob($sDir.$sPluginName.'/templates/language/'.$sLangName.'.php');
|
||||
if($aFiles and count($aFiles)) {
|
||||
foreach ($aFiles as $sFile) {
|
||||
if (file_exists($sFile)) {
|
||||
$aLangModule=include($sFile);
|
||||
$this->aLangMsg=array_merge($this->aLangMsg,$aLangModule);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Установить текущий язык
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<div class="profiler-table">
|
||||
<table class="profiler entries">
|
||||
{foreach from=$oReport->getAllEntries() item=oEntry}
|
||||
<tr class="entry_{$oReport->getId()}_all entry_{$oReport->getId()}_{$oEntry->getName()}{if $oEntry->getChildCount()!=0} has-child{/if}">
|
||||
<td>{if $oEntry->getChildCount()!=0}<img src="{cfg name='path.static.skin'}/images/open.gif" alt="+" title="{$aLang.comment_collapse}/{$aLang.comment_expand}" class="folding lsProfiler_tree" id="tree_{$oReport->getId()}_{$oEntry->getId()}" style="margin-right:3px;"/>{/if}</td>
|
||||
<td width="5%">{$oEntry->getId()}</td>
|
||||
<td width="12%">{$oEntry->getName()}</td>
|
||||
<td width="12%" class="time">{$oEntry->getTimeFull()}</td>
|
||||
<td width="18%">{$oReport->getEntryFullShare($oEntry->getId())}% ({$oReport->getEntryShare($oEntry->getId())}%)</td>
|
||||
<td>{$oEntry->getComment()}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
|
@ -0,0 +1,22 @@
|
|||
{if $oReport}
|
||||
<a href="#" class="profiler tree {if $sAction=='tree'}active{/if}" onclick="lsProfiler.toggleEntriesByClass('{$oReport->getId()}','tree',this); return false;">{$aLang.profiler_entries_show_tree}</a>
|
||||
<a href="#" class="profiler all {if $sAction=='all'}active{/if}" onclick="lsProfiler.toggleEntriesByClass('{$oReport->getId()}','all',this); return false;">{$aLang.profiler_entries_show_all} ({$oReport->getStat('count')})</a>
|
||||
<a href="#" class="profiler query {if $sAction=='query'}active{/if}" onclick="lsProfiler.toggleEntriesByClass('{$oReport->getId()}','query',this); return false;">{$aLang.profiler_entries_show_query} ({$oReport->getStat('query')})</a>
|
||||
|
||||
<div class="profiler-table">
|
||||
<table class="profiler entries">
|
||||
{foreach from=$oReport->getAllEntries() item=oEntry}
|
||||
<tr class="entry_{$oReport->getId()}_all entry_{$oReport->getId()}_{$oEntry->getName()}{if $oEntry->getChildCount()!=0} child{/if}">
|
||||
<td></td>
|
||||
<td width="5%">{$oEntry->getId()}</td>
|
||||
<td width="12%">{$oEntry->getName()}</td>
|
||||
<td width="12%" class="time">{$oEntry->getTimeFull()}</td>
|
||||
<td width="18%">{$oReport->getEntryFullShare($oEntry->getId())}% ({$oReport->getEntryShare($oEntry->getId())}%)</td>
|
||||
<td>{$oEntry->getComment()}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
{else}
|
||||
{$aLang.error}
|
||||
{/if}
|
|
@ -0,0 +1,9 @@
|
|||
{if $oReport}
|
||||
<a href="#" class="profiler tree {if $sAction=='tree'}active{/if}" onclick="lsProfiler.toggleEntriesByClass('{$oReport->getId()}','tree',this); return false;">{$aLang.profiler_entries_show_tree}</a>
|
||||
<a href="#" class="profiler all {if $sAction=='all'}active{/if}" onclick="lsProfiler.toggleEntriesByClass('{$oReport->getId()}','all',this); return false;">{$aLang.profiler_entries_show_all} ({$oReport->getStat('count')})</a>
|
||||
<a href="#" class="profiler query {if $sAction=='query'}active{/if}" onclick="lsProfiler.toggleEntriesByClass('{$oReport->getId()}','query',this); return false;">{$aLang.profiler_entries_show_query} ({$oReport->getStat('query')})</a>
|
||||
|
||||
{include file='plugins/profiler/actions/ActionProfiler/ajax/level.tpl'}
|
||||
{else}
|
||||
{$aLang.error}
|
||||
{/if}
|
|
@ -0,0 +1,35 @@
|
|||
{include file='header.tpl' noShowSystemMessage=false}
|
||||
<script type="text/javascript" src="{cfg name='path.static.skin'}/plugins/profiler/js/profiler.js"></script>
|
||||
|
||||
<div class="topic people top-blogs talk-table">
|
||||
<h1>{$aLang.profiler_reports_title}</h1>
|
||||
<form action="{router page='profiler'}" method="post" id="form_report_list">
|
||||
<input type="hidden" name="security_ls_key" value="{$LIVESTREET_SECURITY_KEY}" />
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="20px"><input type="checkbox" name="" onclick="checkAllReport(this);"></td>
|
||||
<td></td>
|
||||
<td>{$aLang.profiler_table_date}</td>
|
||||
<td align="center">{$aLang.profiler_table_time_full}</td>
|
||||
<td align="center">{$aLang.profiler_table_count_id}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{foreach from=$aReports item=oReport}
|
||||
<tr>
|
||||
<td><input type="checkbox" name="report_del[{$oReport.request_id}]" class="form_reports_checkbox"></td>
|
||||
<td><img src="{cfg name='path.static.skin'}/images/open.gif" alt="+" title="{$aLang.comment_collapse}/{$aLang.comment_expand}" class="folding" id="img_{$oReport.request_id}" /></td>
|
||||
<td>{date_format date=$oReport.request_date}</td>
|
||||
<td align="center" class="time">{$oReport.time_full}</td>
|
||||
<td align="center">{$oReport.count_time_id}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="submit" name="submit_report_delete" value="{$aLang.profiler_report_delete}" onclick="return ($$('.form_reports_checkbox').length==0)?false:confirm('{$aLang.profiler_report_delete_confirm}');">
|
||||
</form>
|
||||
</div>
|
||||
{include file='paging.tpl' aPaging=`$aPaging`}
|
||||
{include file='footer.tpl'}
|
|
@ -0,0 +1,99 @@
|
|||
<div class="profiler-highlight">{$aLang.profiler_filter_highlight}: <input type="text" name="profiler_filter_entries" id="profiler_filter_entries" onchange="lsProfiler.filterNode(this);" class="w50" /> {$aLang.profiler_filter_seconds}</div>
|
||||
<div class="block blogs">
|
||||
<div class="tl"><div class="tr"></div></div>
|
||||
<div class="cl"><div class="cr">
|
||||
|
||||
<h1>{$aLang.profiler_dbstat_title}</h1>
|
||||
|
||||
<form action="{router page='profiler'}" method="POST" name="profiler_import_form">
|
||||
<p>{$aLang.profiler_dbstat_count}: {$aDatabaseStat.count}<br />
|
||||
{$aLang.profiler_dbstat_max_date}: {$aDatabaseStat.max_date}</p>
|
||||
<p>
|
||||
<label for="profiler_date_import">{$aLang.profiler_import_label}:</label><br />
|
||||
<input type="text" id="profiler_date_import" name="profiler_date_import" value="{if $_aRequest.date_import}{$_aRequest.date_import}{else}{if $aDatabaseStat.max_date}{$aDatabaseStat.max_date}{else}{date_format date=$smarty.now format='Y-m-d \0\0\:\0\0\:\0\0'}{/if}{/if}" class="w100p" /><br />
|
||||
<span class="form_note">{$aLang.profiler_import_notice}</span>
|
||||
</p>
|
||||
<p class="buttons">
|
||||
<input type="submit" name="submit_profiler_import" value="{$aLang.profiler_import_submit}"/>
|
||||
</p>
|
||||
</form>
|
||||
<br/>
|
||||
</div></div>
|
||||
<div class="bl"><div class="br"></div></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="block blogs">
|
||||
<div class="tl"><div class="tr"></div></div>
|
||||
<div class="cl"><div class="cr">
|
||||
|
||||
<h1>{$aLang.profiler_filter_title}</h1>
|
||||
|
||||
{literal}
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
document.addEvent('domready', function() {
|
||||
new vlaDatePicker(
|
||||
$('profiler_filter_start'),
|
||||
{
|
||||
separator: '.',
|
||||
leadingZero: true,
|
||||
twoDigitYear: false,
|
||||
alignX: 'center',
|
||||
alignY: 'top',
|
||||
offset: { y: 3 },
|
||||
filePath: DIR_WEB_ROOT+'/engine/lib/external/MooTools_1.2/plugs/vlaCal-v2.1/inc/',
|
||||
prefillDate: false,
|
||||
startMonday: true
|
||||
}
|
||||
);
|
||||
new vlaDatePicker(
|
||||
$('profiler_filter_end'),
|
||||
{
|
||||
separator: '.',
|
||||
leadingZero: true,
|
||||
twoDigitYear: false,
|
||||
alignX: 'center',
|
||||
alignY: 'top',
|
||||
offset: { y: 3 },
|
||||
filePath: DIR_WEB_ROOT+'/engine/lib/external/MooTools_1.2/plugs/vlaCal-v2.1/inc/',
|
||||
prefillDate: false,
|
||||
startMonday: true
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
function eraseFilterForm() {
|
||||
$$("#profiler_filter_per_page, #profiler_filter_time, #profiler_filter_start, #profiler_filter_end").each(
|
||||
function(item,index){
|
||||
return item.set('value','');
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
<form action="{router page='profiler'}" method="GET" name="profiler_filter_form">
|
||||
<p><label for="profiler_filter_start">{$aLang.profiler_filter_label_date}:</label><br />
|
||||
<input type="text" id="profiler_filter_start" name="start" value="{$_aRequest.start}" class="w100p" style="width: 44%" readonly="readonly" /> —
|
||||
<input type="text" id="profiler_filter_end" name="end" value="{$_aRequest.end}" class="w100p" style="width: 44%" readonly="readonly" /><br />
|
||||
<span class="form_note">{$aLang.profiler_filter_notice_date}</span>
|
||||
</p>
|
||||
|
||||
<p><label for="profiler_filter_time">{$aLang.profiler_filter_label_time}:</label>
|
||||
<input type="text" id="profiler_filter_time" name="time" value="{$_aRequest.time}" class="w100" /><br />
|
||||
<span class="form_note">{$aLang.profiler_filter_notice_time}</span>
|
||||
</p>
|
||||
|
||||
<p><label for="profiler_filter_per_page">{$aLang.profiler_filter_label_per_page}:</label>
|
||||
<input type="text" id="profiler_filter_per_page" name="per_page" value="{if $_aRequest.per_page}{$_aRequest.per_page}{else}{cfg name='module.profiler.per_page'}{/if}" class="w50" /><br />
|
||||
<span class="form_note">{$aLang.profiler_filter_notice_per_page}</span>
|
||||
</p>
|
||||
|
||||
<p class="buttons">
|
||||
<input type="submit" name="submit_profiler_filter" value="{$aLang.profiler_filter_submit}"/>
|
||||
</p>
|
||||
</form>
|
||||
<div class="right"><a href="#" onclick="return eraseFilterForm();">{$aLang.profiler_filter_erase_form}</a> | <a href="{router page='profiler'}">{$aLang.profiler_filter_erase}</a></div>
|
||||
</div></div>
|
||||
<div class="bl"><div class="br"></div></div>
|
||||
</div>
|
|
@ -162,13 +162,10 @@ var lsProfilerClass = new Class({
|
|||
msgErrorBox.alert(result.sMsgTitle,result.sMsg);
|
||||
} else {
|
||||
var trReport = $(thisObj.options.prefix.td+reportId).empty();
|
||||
//var trReport=new Element('tr', {'id':reportId});
|
||||
trReport.adopt(new Element('td',{
|
||||
'colspan': 5,
|
||||
'html' : result.sReportText
|
||||
}));
|
||||
//trReport.inject(trCurrent,'after');
|
||||
//thisObj.make(thisObj.options.classes.treeNode);
|
||||
trReport.getElements('img').each(function(img, i){thisObj.makeImg(img);});
|
||||
}
|
||||
},
|
Loading…
Reference in a new issue