?>
            <?php 
        // changes
        $changes = __($revision['action']);
        $urlHistory = url(array('item-id' => $revision['document_id'], 'file-id' => $revision['document_page_id'], 'namespace-index' => $revision['namespace_index']), 'scripto_history');
        $changes .= ' (<a href="' . html_escape($urlHistory) . '">' . __('hist') . '</a>)';
        // document page name
        $documentPageName = ScriptoPlugin::truncate($revision['document_page_name'], 30);
        $urlTranscribe = url(array('action' => 'transcribe', 'item-id' => $revision['document_id'], 'file-id' => $revision['document_page_id']), 'scripto_action_item_file');
        if (1 == $revision['namespace_index']) {
            $urlTranscribe .= '#discussion';
        } else {
            $urlTranscribe .= '#transcription';
        }
        // document title
        $documentTitle = ScriptoPlugin::truncate($revision['document_title'], 30, __('Untitled'));
        $urlItem = url(array('controller' => 'items', 'action' => 'show', 'id' => $revision['document_id']), 'id');
        // length changed
        $lengthChanged = $revision['new_length'] - $revision['old_length'];
        if (0 <= $lengthChanged) {
            $lengthChanged = "+{$lengthChanged}";
        }
        ?>
            <tr>
                <td><?php 
        echo $changes;
        ?>
</td>
                <td><a href="<?php 
        echo html_escape($urlTranscribe);
        ?>
Example #2
0
    </thead>
    <tbody>
    <?php 
        foreach ($this->documentPages as $documentPage) {
            ?>
    <?php 
            // document page name
            $documentPageName = ScriptoPlugin::truncate($documentPage['document_page_name'], 60);
            $urlTranscribe = url(array('action' => 'transcribe', 'item-id' => $documentPage['document_id'], 'file-id' => $documentPage['document_page_id']), 'scripto_action_item_file');
            if (1 == $documentPage['namespace_index']) {
                $urlTranscribe .= '#discussion';
            } else {
                $urlTranscribe .= '#transcription';
            }
            // document title
            $documentTitle = ScriptoPlugin::truncate($documentPage['document_title'], 60, __('Untitled'));
            $urlItem = url(array('controller' => 'items', 'action' => 'show', 'id' => $documentPage['document_id']), 'id');
            ?>
    <tr>
        <td><a href="<?php 
            echo html_escape($urlTranscribe);
            ?>
"><?php 
            if (1 == $documentPage['namespace_index']) {
                echo __('Talk');
                ?>
: <?php 
            }
            echo $documentPageName;
            ?>
</a></td>
        $urlHistory = url(array('item-id' => $recentChange['document_id'], 'file-id' => $recentChange['document_page_id'], 'namespace-index' => $recentChange['namespace_index']), 'scripto_history');
        if ($recentChange['new'] || in_array($recentChange['action'], array('protected', 'unprotected'))) {
            $changes .= ' (' . __('diff') . ' | <a href="' . html_escape($urlHistory) . '">' . __('hist') . '</a>)';
        } else {
            $changes .= ' (<a href="' . html_escape($urlDiff) . '">' . __('diff') . '</a> | <a href="' . html_escape($urlHistory) . '">' . __('hist') . '</a>)';
        }
        // document page name
        $documentPageName = ScriptoPlugin::truncate($recentChange['document_page_name'], 30);
        $urlTranscribe = url(array('action' => 'transcribe', 'item-id' => $recentChange['document_id'], 'file-id' => $recentChange['document_page_id']), 'scripto_action_item_file');
        if (1 == $recentChange['namespace_index']) {
            $urlTranscribe .= '#discussion';
        } else {
            $urlTranscribe .= '#transcription';
        }
        // document title
        $documentTitle = ScriptoPlugin::truncate($recentChange['document_title'], 30, __('Untitled'));
        $urlItem = url(array('controller' => 'items', 'action' => 'show', 'id' => $recentChange['document_id']), 'id');
        // length changed
        $lengthChanged = $recentChange['new_length'] - $recentChange['old_length'];
        if (0 <= $lengthChanged) {
            $lengthChanged = "+{$lengthChanged}";
        }
        ?>
            <tr>
                <td><?php 
        echo $changes;
        ?>
</td>
                <td><a href="<?php 
        echo html_escape($urlTranscribe);
        ?>