コード例 #1
0
ファイル: dmSitemapMenu.php プロジェクト: theolymp/diem
 protected function addPage(DmPage $page)
 {
     $pageMenu = $this->addChild('page-' . $page->get('id'), $page)->label(dmString::escape($page->get('name')))->secure($page->get('is_secure'))->credentials($page->get('credentials'));
     foreach ($page->get('__children') as $child) {
         !in_array($child->id, $this->hide) && $pageMenu->addPage($child);
     }
 }
コード例 #2
0
ファイル: dmFrontLinkTagPage.php プロジェクト: rafix/diem
 protected function renderText()
 {
     if (isset($this->options['text'])) {
         return $this->options['text'];
     }
     return dmString::escape($this->page->_getI18n('name'));
 }
コード例 #3
0
 protected function renderSubject(dmEventLogEntry $entry)
 {
     $subject = $this->i18n->__($entry->get('subject'));
     if ($record = $entry->get('record_object')) {
         $subject = $this->helper->link($record)->text(dmString::escape($subject));
     }
     return $subject;
 }
コード例 #4
0
ファイル: dmAdminLinkTag.php プロジェクト: vjousse/diem
 protected function renderText()
 {
     if (!isset($this->options['text'])) {
         if (is_object($this->resource)) {
             if ($this->resource instanceof DmPage) {
                 $text = $this->resource->_getI18n('name');
             } else {
                 $text = (string) $this->resource;
             }
             $text = dmString::escape($text);
         } else {
             $text = $this->getBaseHref();
         }
     } else {
         $text = $this->options['text'];
     }
     return $text;
 }
コード例 #5
0
function escape($text)
{
    return dmString::escape($text);
}
コード例 #6
0
ファイル: dmFrontPagerView.php プロジェクト: theolymp/diem
 public function getDefaultOptions()
 {
     return array('navigation_top' => true, 'navigation_bottom' => true, 'separator' => null, 'class' => null, 'current_class' => 'current', 'first' => dmString::escape('<<'), 'prev' => dmString::escape('<'), 'next' => dmString::escape('>'), 'last' => dmString::escape('>>'), 'nb_links' => 9, 'ajax' => false, 'url_params' => array(), 'anchor' => false, 'widget_id' => null);
 }
コード例 #7
0
 /**
  * @see sfValidatorString
  */
 protected function doClean($value)
 {
     return parent::doClean(dmString::escape((string) $value));
 }
コード例 #8
0
 public function executeMarkdown(dmWebRequest $request)
 {
     $this->forward404Unless($request->isMethod('post'));
     $text = $request->getParameter('text');
     return $this->renderText($this->getService('markdown')->toHtml(dmString::escape($text, ENT_NOQUOTES)));
 }
コード例 #9
0
ファイル: _show.php プロジェクト: Regmaya/diem-project
 * Action for Version : Show
 * Vars : $version
 */
echo _open('div.version.show');
echo _tag('h1.t_big', $version->name);
echo _tag('h2.t_baseline', $version->resume);
if ($version->githubTag) {
    echo _tag('p.mb10', _link($version->downloadUrl)->text(_tag('span.download_link', __('Download ' . $version . ' in TGZ')))->set('.button.large.orange'));
}
echo _tag('h2.t_medium', __('Version notes'));
echo _tag('p.quiet.mb5', format_date($version->createdAt, 'D'));
echo markdown($version->text);
echo _tag('h2.t_medium', __('Changelog'));
if ($version->svnUrl) {
    echo _tag('p.mb10', _link('http://trac.symfony-project.org/log/plugins/diemPlugin/trunk')->text(__('View the changelog on symfony trac')));
} elseif ($version->githubTag) {
    echo _open('ul.commits');
    foreach ($commits as $commit) {
        echo _tag('li.clickable', _link($commit['url'])->text(auto_link_text(escape($commit['message'])))->set('.block') . _tag('span.quiet.little', format_date($commit['committed_date'], 'd/MM H:mm') . ' by ' . escape($commit['author']['name'])));
    }
    echo _close('ul');
    echo _tag('p.mt10', 'And many more... ' . _link('http://github.com/diem-project/diem/commits/' . $version->githubTag)->text(__('View more commits on github')));
}
$markdown = markdown($version->changelog);
if ($version->changelog && '<div class="markdown"></div>' == $markdown) {
    echo _tag('em', 'Sorry, the changelog is so big, the markdown parser can not transform it.');
    echo _tag('div.markdown.mt10', nl2br(dmString::escape($version->changelog)));
} else {
    echo $markdown;
}
echo _close('div');
コード例 #10
0
 protected function renderUserTime(dmEventLogEntry $entry)
 {
     $username = $entry->get('username');
     return ($username ? '<strong class="mr10">' . dmString::escape(dmString::truncate($username, 20, '...')) . '</strong><br />' : '') . $entry->get('ip');
 }
コード例 #11
0
 protected function renderLink(dmStaticLogEntry $entry)
 {
     $uri = ltrim($entry->get('uri'), '/');
     $text = $uri ? $uri : 'front home';
     return $this->helper->link('app:front/' . $uri)->text(dmString::escape($text));
 }
コード例 #12
0
 protected function renderUserAndBrowser(dmRequestLogEntry $entry)
 {
     $browser = $entry->get('browser');
     return sprintf('<div class="browser %s">%s<br />%s %s</div>', $this->getBrowserIcon($browser), ($username = $entry->get('username')) ? '<strong class="mr5">' . dmString::escape(dmString::truncate($username, 20, '...')) . '</strong>' : $this->renderIp($entry->get('ip')), ucfirst($browser->getName()), $browser->getVersion());
 }
コード例 #13
0
ファイル: dmRequestLogView.php プロジェクト: theolymp/diem
 protected function renderLink(dmRequestLogEntry $entry)
 {
     $uri = ltrim($entry->get('uri'), '/');
     $text = $uri ? $uri : $entry->get('app') . ' home';
     return $this->helper->link('app:' . $entry->get('app') . '/' . $uri)->text(dmString::escape($text));
 }
コード例 #14
0
 public function getMarkdownText(myGeshiMarkdown $markdown)
 {
     return $markdown->toHtml(dmString::escape($this->text, ENT_NOQUOTES));
 }