<commit_before><? 
defined('C5_EXECUTE') or die("Access Denied.");

// HELPERS
$valt = Loader::helper('validation/token');
$th = Loader::helper('text');


// VARIABLES

// Check if entries to show, assign to boolean var.
$areEntries = count($entries) > 0 ? true : false;

?>

	<?=Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Logs'), false, false, false);?>
    
    <? if(!$areEntries) { ?>
    
    <div class="ccm-pane-body ccm-pane-body-footer">
    
    	<p><?=t('There are no log entries to show at the moment.')?></p>
    
    </div>
    
    <?=Loader::helper('concrete/dashboard')->getDashboardPaneFooterWrapper(false);?>
    
    <? } else { ?>
    
    <div class="ccm-pane-options ccm-pane-options-permanent-search">
    	<form method="post" id="ccm-log-search"  action="<?=$pageBase?>">
        	<div class="row">
                <div class="span5">
                    <label for="keywords"><?=t('Keywords')?></label>
                    <div class="input">
                        <?=$form->text('keywords', $keywords, array('style'=>'width:180px;'))?>
                    </div>
                </div>
                <div class="span6">
                    <label for="logType"><?=t('Type')?></label>
                    <div class="input">
                        <?=$form->select('logType', $logTypes, array('style'=>'width:180px;'))?>
                    <?=$form->submit('search',t('Search') )?>
                    </div>
                </div>
            </div>
        </form>
    </div>
        
	<div class="ccm-pane-body <? if(!$paginator || !strlen($paginator->getPages())>0) { ?>ccm-pane-body-footer <? } ?>">

        <table border="0" cellspacing="0" cellpadding="0" class="grid-list zebra-striped">
        	<thead>
                <tr>
                    <th class="subheaderActive"><?=t('Date/Time')?></th>
                    <th class="subheader"><?=t('Type')?></th>
                    <th class="subheader"><?=t('User')?></th>
                    <th class="subheader" style="position: relative">       <input class="btn error" style="position: absolute; top: 4px; right: 4px" type="button" onclick="if (confirm('<?=t("Are you sure you want to clear this log?")?>')) { location.href='<?=$this->url('/dashboard/reports/logs', 'clear', $valt->generate(), $_POST['logType'])?>'}" value="<?=t('Clear Log')?>" />
<?=t('Text')?></th>
                </tr>
			</thead>
            <tbody>
				<? foreach($entries as $ent) { ?>
                <tr>
                    <td valign="top" style="white-space: nowrap" class="active"><?=date(DATE_APP_GENERIC_TS, strtotime($ent->getTimestamp('user')))?><? if (date('m-d-y') != date('m-d-y', strtotime($ent->getTimestamp('user')))) { ?>
                        <?=t(' at ')?><?=date(DATE_APP_GENERIC_MDY, strtotime($ent->getTimestamp('user')))?>
                    <? } ?></td>
                    <td valign="top"><strong><?=$ent->getType()?></strong></td>
                    <td valign="top"><strong><?php
                    if($ent->getUser() == NULL){
                        echo t("Guest");
                    }
                    else{
                        $u = User::getByUserID($ent->getUser());
                        echo $u->getUserName();
                    }
                    ?></strong></td>
                    <td style="width: 100%"><?=$th->makenice($ent->getText())?></td>
                </tr>
                <? } // END FOREACH ?><commit_msg>New names represent data better<commit_after><? 
defined('C5_EXECUTE') or die("Access Denied.");

// HELPERS
$valt = Loader::helper('validation/token');
$th = Loader::helper('text');


// VARIABLES

// Check if entries to show, assign to boolean var.
$areEntries = count($entries) > 0 ? true : false;

?>

	<?=Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Logs'), false, false, false);?>
    
    <? if(!$areEntries) { ?>
    
    <div class="ccm-pane-body ccm-pane-body-footer">
    
    	<p><?=t('There are no log entries to show at the moment.')?></p>
    
    </div>
    
    <?=Loader::helper('concrete/dashboard')->getDashboardPaneFooterWrapper(false);?>
    
    <? } else { ?>
    
    <div class="ccm-pane-options ccm-pane-options-permanent-search">
    	<form method="post" id="ccm-log-search"  action="<?=$pageBase?>">
        	<div class="row">
                <div class="span5">
                    <label for="keywords"><?=t('Keywords')?></label>
                    <div class="input">
                        <?=$form->text('keywords', $keywords, array('style'=>'width:180px;'))?>
                    </div>
                </div>
                <div class="span6">
                    <label for="logType"><?=t('Type')?></label>
                    <div class="input">
                        <?=$form->select('logType', $logTypes, array('style'=>'width:180px;'))?>
                    <?=$form->submit('search',t('Search') )?>
                    </div>
                </div>
            </div>
        </form>
    </div>
        
	<div class="ccm-pane-body <? if(!$paginator || !strlen($paginator->getPages())>0) { ?>ccm-pane-body-footer <? } ?>">

        <table border="0" cellspacing="0" cellpadding="0" class="grid-list zebra-striped">
        	<thead>
                <tr>
                    <th class="subheaderActive"><?=t('Date/Time')?></th>
                    <th class="subheader"><?=t('Type')?></th>
                    <th class="subheader"><?=t('User')?></th>
                    <th class="subheader" style="position: relative">       <input class="btn error" style="position: absolute; top: 4px; right: 4px" type="button" onclick="if (confirm('<?=t("Are you sure you want to clear this log?")?>')) { location.href='<?=$this->url('/dashboard/reports/logs', 'clear', $valt->generate(), $_POST['logType'])?>'}" value="<?=t('Clear Log')?>" />
<?=t('Text')?></th>
                </tr>
			</thead>
            <tbody>
				<? foreach($entries as $ent) { ?>
                <tr>
                    <td valign="top" style="white-space: nowrap" class="active"><?=date(DATE_APP_GENERIC_TS, strtotime($ent->getTimestamp('user')))?><? if (date('m-d-y') != date('m-d-y', strtotime($ent->getTimestamp('user')))) { ?>
                        <?=t(' at ')?><?=date(DATE_APP_GENERIC_MDY, strtotime($ent->getTimestamp('user')))?>
                    <? } ?></td>
                    <td valign="top"><strong><?=$ent->getType()?></strong></td>
                    <td valign="top"><strong><?php
                    if($ent->getUserID() == NULL){
                        echo t("Guest");
                    }
                    else{
                        $u = User::getByUserID($ent->getUserID());
                        echo $u->getUserName();
                    }
                    ?></strong></td>
                    <td style="width: 100%"><?=$th->makenice($ent->getText())?></td>
                </tr>
                <? } // END FOREACH ?>
{'fraction_non_alphanumeric': 0.21524792204069934, 'fraction_numerical': 0.005445686443106907, 'mean_word_length': 1.9710515112813964, 'pattern_counts': {'":': 0, '<': 169, '<?xml version=': 0, '>': 211, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7482565', 'n_tokens_mistral': 2201, 'n_tokens_neox': 2116, 'n_words': 350}