/**
  * Extracts variables for a given column from a data element
  * so that they may be assigned to template before rendering.
  * @param $row GridRow
  * @param $column GridColumn
  * @return array
  */
 function getTemplateVarsFromRowColumn($row, $column)
 {
     $element = $row->getData();
     $columnId = $column->getId();
     assert(is_a($element, 'DataObject') && !empty($columnId));
     // there is only one column in the Footer grid.
     switch ($columnId) {
         case 'title':
             return array('label' => '<a href="' . String::stripUnsafeHtml($element->getLocalizedUrl()) . '" target="_blank">' . $element->getLocalizedTitle() . '</a>');
     }
 }
 /**
  * Extracts variables for a given column from a data element
  * so that they may be assigned to template before rendering.
  * @param $row GridRow
  * @param $column GridColumn
  * @return array
  */
 function getTemplateVarsFromRowColumn($row, $column)
 {
     $element =& $row->getData();
     $columnId = $column->getId();
     assert(!empty($columnId));
     switch ($columnId) {
         case 'url':
             return array('label' => '<a href="' . String::stripUnsafeHtml($element['url']) . '" target="_blank">' . String::stripUnsafeHtml($element['url']) . '</a>');
         case 'shares':
             return array('label' => $element['shares']);
     }
 }
	<?php 
$this->_tag_stack[] = array('iterate', array('from' => 'issues', 'item' => 'issue'));
$_block_repeat = true;
$this->_plugins['block']['iterate'][0][0]->smartyIterate($this->_tag_stack[count($this->_tag_stack) - 1][1], null, $this, $_block_repeat);
while ($_block_repeat) {
    ob_start();
    ?>
	<tr valign="top" class="data" id="issue-<?php 
    echo $this->_tpl_vars['issue']->getId();
    ?>
">
		<td class="drag"><a href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('op' => 'issueToc', 'path' => $this->_tpl_vars['issue']->getId()), $this);
    ?>
" class="action"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['issue']->getIssueIdentification()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
    ?>
</a></td>
		<td class="drag"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['issue']->getDatePublished()) ? $this->_run_mod_handler('date_format', true, $_tmp, $this->_tpl_vars['dateFormatShort']) : smarty_modifier_date_format($_tmp, $this->_tpl_vars['dateFormatShort'])) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
    ?>
</td>
		<td class="drag"><?php 
    echo is_array($_tmp = $this->_tpl_vars['issue']->getNumArticles()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
</td>
		<td><a href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('op' => 'moveIssue', 'd' => 'u', 'id' => $this->_tpl_vars['issue']->getId(), 'issuesPage' => $this->_tpl_vars['page']), $this);
    ?>
">&uarr;</a>	<a href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('op' => 'moveIssue', 'd' => 'd', 'id' => $this->_tpl_vars['issue']->getId(), 'issuesPage' => $this->_tpl_vars['page']), $this);
    $this->assign('issue', $this->_tpl_vars['articleData']['issue']);
    ?>
	<tr valign="top">
		<td><input type="checkbox" name="articleId[]" value="<?php 
    echo $this->_tpl_vars['article']->getId();
    ?>
"/></td>
		<td><a href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('page' => 'issue', 'op' => 'view', 'path' => $this->_tpl_vars['issue']->getId()), $this);
    ?>
" class="action"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['issue']->getIssueIdentification()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
    ?>
</a></td>
		<td><?php 
    echo is_array($_tmp = $this->_tpl_vars['article']->getLocalizedTitle()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp);
    ?>
</td>
		<td><?php 
    echo is_array($_tmp = $this->_tpl_vars['article']->getAuthorString()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
</td>
		<td align="right"><a href="<?php 
    echo $this->_plugins['function']['plugin_url'][0][0]->smartyPluginUrl(array('path' => is_array($_tmp = 'exportArticle') ? $this->_run_mod_handler('to_array', true, $_tmp, $this->_tpl_vars['article']->getId()) : $this->_plugins['modifier']['to_array'][0][0]->smartyToArray($_tmp, $this->_tpl_vars['article']->getId())), $this);
    ?>
" class="action"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.export"), $this);
    ?>
</a></td>
	</tr>
	<tr>
Ejemplo n.º 5
0
 /**
  * Set up the comment template.
  * @param $request PKPRequest
  * @param $article Article
  * @param $galleyId int
  * @param $comment Comment
  */
 function setupTemplate(&$request, $article, $galleyId, $comment = null)
 {
     parent::setupTemplate();
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_READER);
     $templateMgr =& TemplateManager::getManager();
     $journal =& $request->getJournal();
     if (!$journal || !$journal->getSetting('restrictSiteAccess')) {
         $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     }
     $pageHierarchy = array(array($request->url(null, 'article', 'view', array($article->getBestArticleId($request->getJournal()), $galleyId)), String::stripUnsafeHtml($article->getLocalizedTitle()), true));
     if ($comment) {
         $pageHierarchy[] = array($request->url(null, 'comment', 'view', array($article->getId(), $galleyId)), 'comments.readerComments');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
Ejemplo n.º 6
0
 function setupTemplate($paper, $galleyId, $comment = null)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     Locale::requireComponents(array(LOCALE_COMPONENT_PKP_READER));
     $pageHierarchy = array(array(Request::url(null, null, 'paper', 'view', array($paper->getBestPaperId(Request::getConference()), $galleyId)), String::stripUnsafeHtml($paper->getLocalizedTitle()), true));
     if ($comment) {
         $pageHierarchy[] = array(Request::url(null, null, 'comment', 'view', array($paper->getId(), $galleyId)), 'comments.readerComments');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
?>


<?php 
if ($this->_tpl_vars['currentJournal']->getSetting('metaCitations')) {
    ?>
	<div id="citations">
	<h4><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.citations"), $this);
    ?>
</h4>

	<table width="100%" class="data">
		<tr valign="top">
			<td width="20%" class="label"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.citations"), $this);
    ?>
</td>
			<td width="80%" class="value"><?php 
    echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['submission']->getCitations()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
    ?>
</td>
		</tr>
	</table>
	</div>
<?php 
}
?>

</div><!-- metadata -->
 /**
  * Format the contents of the email
  * @param $emailLogEntry EmailLogEntry
  * @return string Formatted email
  */
 function _formatEmail($emailLogEntry)
 {
     assert(is_a($emailLogEntry, 'EmailLogEntry'));
     $text = array();
     $text[] = __('email.from') . ': ' . htmlspecialchars($emailLogEntry->getFrom());
     $text[] = __('email.to') . ': ' . htmlspecialchars($emailLogEntry->getRecipients());
     $text[] = __('email.subject') . ': ' . htmlspecialchars($emailLogEntry->getSubject());
     $text[] = $emailLogEntry->getBody();
     return nl2br(String::stripUnsafeHtml(implode(PHP_EOL . PHP_EOL, $text)));
 }
    echo is_array($_tmp = $this->_tpl_vars['referral']->getDateAdded()) ? $this->_run_mod_handler('date_format', true, $_tmp, $this->_tpl_vars['dateFormatShort']) : smarty_modifier_date_format($_tmp, $this->_tpl_vars['dateFormatShort']);
    ?>
</td>
		<td><?php 
    echo is_array($_tmp = $this->_tpl_vars['referral']->getLinkCount()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
</td>
		<td><a href="<?php 
    echo is_array($_tmp = $this->_tpl_vars['referral']->getUrl()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['referral']->getUrl()) ? $this->_run_mod_handler('truncate', true, $_tmp, 50) : $this->_plugins['modifier']['truncate'][0][0]->smartyTruncate($_tmp, 50)) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
</a></td>
		<td><?php 
    echo is_array($_tmp = $this->_tpl_vars['articleTitles'][$this->_tpl_vars['articleId']]) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp);
    ?>
</td>
		<td><?php 
    echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['referral']->getReferralName()) ? $this->_run_mod_handler('truncate', true, $_tmp, 50) : $this->_plugins['modifier']['truncate'][0][0]->smartyTruncate($_tmp, 50)) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
    ?>
</td>
		<td><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => $this->_tpl_vars['referral']->getStatusKey()), $this);
    ?>
</td>
		<td align="right">
			<a class="action" href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('page' => 'referral', 'op' => 'editReferral', 'path' => $this->_tpl_vars['referral']->getId()), $this);
    ?>
"><?php 
Ejemplo n.º 10
0
 function setupTemplate($article, $galleyId, $comment = null)
 {
     $templateMgr =& TemplateManager::getManager();
     $journal =& Request::getJournal();
     if (!$journal || !$journal->getSetting('restrictSiteAccess')) {
         $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     }
     $pageHierarchy = array(array(Request::url(null, 'article', 'view', array($article->getBestArticleId(Request::getJournal()), $galleyId)), String::stripUnsafeHtml($article->getArticleTitle()), true));
     if ($comment) {
         $pageHierarchy[] = array(Request::url(null, 'comment', 'view', array($article->getArticleId(), $galleyId)), 'comments.readerComments');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
<?php 
if ($this->_tpl_vars['error']) {
    ?>
	<span class="pkp_form_error"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => $this->_tpl_vars['error'], 'reason' => $this->_tpl_vars['reason']), $this);
    ?>
</span>
	<br />
	<br />
<?php 
}
?>

<input type="hidden" name="source" value="<?php 
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['source']) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
?>
" />

<?php 
if (!$this->_tpl_vars['implicitAuth']) {
    ?>
	<table id="signinTable" class="data">
	<tr>
		<td class="label"><label for="loginUsername"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.username"), $this);
    ?>
</label></td>
		<td class="value"><input type="text" id="loginUsername" name="username" value="<?php 
    echo is_array($_tmp = $this->_tpl_vars['username']) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
	<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.mailingAddress"), $this);
?>
:</td>
	<td class="value"><?php 
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['user']->getMailingAddress()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
?>
</td>
</tr>
<tr valign="top">
	<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.biography"), $this);
?>
:</td>
	<td class="value"><?php 
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['user']->getLocalizedBiography()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
?>
</td>
</tr>
<tr valign="top">
	<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.workingLanguages"), $this);
?>
:</td>
	<td class="value"><?php 
$_from = $this->_tpl_vars['user']->getLocales();
if (!is_array($_from) && !is_object($_from)) {
    settype($_from, 'array');
}
$this->_foreach['workingLanguages'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['workingLanguages']['total'] > 0) {
		<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.country"), $this);
?>
</td>
		<td class="value"><?php 
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['country']) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
?>
</td>
	</tr>
	<tr valign="top">
		<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.biography"), $this);
?>
</td>
		<td class="value"><?php 
echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['user']->getUserBiography()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
?>
</td>
	</tr>
	<tr valign="top">
		<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.workingLanguages"), $this);
?>
</td>
		<td class="value"><?php 
$_from = $this->_tpl_vars['user']->getLocales();
if (!is_array($_from) && !is_object($_from)) {
    settype($_from, 'array');
}
$this->_foreach['workingLanguages'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['workingLanguages']['total'] > 0) {
Ejemplo n.º 14
0
 /**
  * Output filter adds data citation to submission summary.
  * @param $output string
  * @param $templateMgr TemplateManager
  * @return $string
  */
 function submissionOutputFilter($output, &$templateMgr)
 {
     $submission =& $templateMgr->get_template_vars('submission');
     if (!isset($submission)) {
         return $output;
     }
     $dataverseStudyDao =& DAORegistry::getDAO('DataverseStudyDAO');
     $study =& $dataverseStudyDao->getStudyBySubmissionId($submission->getId());
     $dataCitation = '';
     if (isset($study)) {
         $dataCitation = $this->_formatDataCitation($study->getDataCitation(), $study->getPersistentUri());
     } else {
         // There may be an external data citation
         $dataCitation = $submission->getLocalizedData('externalDataCitation');
     }
     if (!$dataCitation) {
         return $output;
     }
     $index = strpos($output, '<td class="label">' . __('submission.submitter'));
     if ($index !== false) {
         $newOutput = substr($output, 0, $index);
         $newOutput .= '<td class="label">' . __('plugins.generic.dataverse.dataCitation') . '</td>';
         $newOutput .= '<td class="value" colspan="2">' . String::stripUnsafeHtml($dataCitation) . '</td></tr><tr>';
         $newOutput .= substr($output, $index);
         $output = $newOutput;
     }
     $templateMgr->unregister_outputfilter('submissionSummaryOutputFilter');
     return $output;
 }
                        <?php 
}
unset($_from);
?>
		</td>
	</tr>
	<?php 
if ($this->_tpl_vars['submission']->getCommentsToEditor()) {
    ?>
	<tr valign="top">
		<td width="20%" class="label"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "article.commentsToEditor"), $this);
    ?>
</td>
		<td width="80%" colspan="2" class="data"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['submission']->getCommentsToEditor()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
    ?>
</td>
	</tr>
	<?php 
}
?>
	<?php 
if ($this->_tpl_vars['publishedArticle']) {
    ?>
	<tr>
		<td class="label"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.abstractViews"), $this);
    ?>
</td>
		<td><?php 
                    ?>
				<?php 
                }
                ?>
			</td>
		</tr>
		<?php 
                if ($this->_tpl_vars['currentJournal']->getSetting('requireReviewerCompetingInterests')) {
                    ?>
			<tr valign="top">
				<td class="label"><?php 
                    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "reviewer.competingInterests"), $this);
                    ?>
</td>
				<td><?php 
                    echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['reviewAssignment']->getCompetingInterests()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
                    ?>
</td>
			</tr>
		<?php 
                }
                ?>
		<?php 
                if ($this->_tpl_vars['reviewFormResponses'][$this->_tpl_vars['reviewId']]) {
                    ?>
			<tr valign="top">
				<td class="label"><?php 
                    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.reviewFormResponse"), $this);
                    ?>
</td>
				<td>
		<div id="articleCitations">
		<h4><?php 
        echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.citations"), $this);
        ?>
</h4>
		<br />
		<div>
			<?php 
        $this->_tag_stack[] = array('iterate', array('from' => 'citationFactory', 'item' => 'citation'));
        $_block_repeat = true;
        $this->_plugins['block']['iterate'][0][0]->smartyIterate($this->_tag_stack[count($this->_tag_stack) - 1][1], null, $this, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
				<p><?php 
            echo is_array($_tmp = $this->_tpl_vars['citation']->getRawCitation()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp);
            ?>
</p>
			<?php 
            $_block_content = ob_get_contents();
            ob_end_clean();
            $_block_repeat = false;
            echo $this->_plugins['block']['iterate'][0][0]->smartyIterate($this->_tag_stack[count($this->_tag_stack) - 1][1], $_block_content, $this, $_block_repeat);
        }
        array_pop($this->_tag_stack);
        ?>
		</div>
		<br />
		</div>
	<?php 
    }