function main_applicationlog($eventData)
{
    global $gLocale, $gLocale, $gPageTitle, $wuiMainVertGroup, $gPageContent;
    $query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT appid FROM applications WHERE id=' . $eventData['appid']);
    $applicationData = $query->getFields();
    $gPageContent = new WuiVertgroup('vgroup');
    $appLogContent = '';
    if (file_exists(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/applications/' . $applicationData['appid'] . '/application.log')) {
        $logToolbar = new WuiToolBar('logbar');
        $cleanLogAction = new \Innomatic\Wui\Dispatch\WuiEventsCall();
        $cleanLogAction->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', ''));
        $cleanLogAction->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'cleanmodlog', array('appid' => $applicationData['appid'])));
        $cleanLogButton = new WuiButton('cleanlogbutton', array('label' => $gLocale->getStr('cleanlog_button'), 'themeimage' => 'documentdelete', 'action' => $cleanLogAction->getEventsCallString()));
        $logToolbar->addChild($cleanLogButton);
        $logFrame = new WuiHorizframe('logframe');
        $logFrame->addChild($logToolbar);
        $wuiMainVertGroup->addChild($logFrame);
        $appLogContent = file_get_contentes(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/applications/' . $applicationData['appid'] . '/application.log');
    }
    $wuiVGroup->addChild(new WuiText('modlog', array('disp' => 'action', 'readonly' => 'true', 'value' => \Innomatic\Wui\Wui::utf8_entities($appLogContent), 'rows' => '20', 'cols' => '120')), 0, 1);
    $gPageTitle .= ' - ' . $applicationData['appid'] . ' - ' . $gLocale->getStr('modlog.title');
}
Esempio n. 2
0
function main_modulelog($eventData)
{
    global $env, $hui_mainframe, $amp_locale, $hui_mainstatus, $hui_titlebar, $hui_mainvertgroup;
    $query = $env['ampdb']->execute('SELECT modid ' . 'FROM modules ' . 'WHERE id=' . $eventData['modid']);
    $module_data = $query->Fields();
    $hui_vgroup = new HuiVertGroup('vgroup');
    $mod_log_content = '';
    if (file_exists(MODULE_PATH . $module_data['modid'] . '/module.log')) {
        $log_toolbar = new HuiToolBar('logbar');
        $cleanlog_action = new HuiEventsCall();
        $cleanlog_action->AddEvent(new HuiEvent('main', 'default', ''));
        $cleanlog_action->AddEvent(new HuiEvent('pass', 'cleanmodlog', array('modid' => $module_data['modid'])));
        $cleanlog_button = new HuiButton('cleanlogbutton', array('label' => $amp_locale->GetStr('cleanlog_button'), 'themeimage' => 'editdelete', 'action' => $cleanlog_action->GetEventsCallString()));
        $log_toolbar->AddChild($cleanlog_button);
        $log_frame = new HuiHorizFrame('logframe');
        $log_frame->AddChild($log_toolbar);
        $hui_mainvertgroup->AddChild($log_frame);
        $mod_log_content = file_get_contentes(MODULE_PATH . $module_data['modid'] . '/module.log');
    }
    $hui_vgroup->AddChild(new HuiText('modlog', array('disp' => 'pass', 'readonly' => 'true', 'value' => htmlentities($mod_log_content), 'rows' => '20', 'cols' => '120')), 0, 1);
    $hui_mainframe->AddChild($hui_vgroup);
    $hui_titlebar->mTitle .= ' - ' . $module_data['modid'] . ' - ' . $amp_locale->GetStr('modlog.title');
}