• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP util_get_alt_row_color函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中util_get_alt_row_color函数的典型用法代码示例。如果您正苦于以下问题:PHP util_get_alt_row_color函数的具体用法?PHP util_get_alt_row_color怎么用?PHP util_get_alt_row_color使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了util_get_alt_row_color函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: all

 function all(&$request)
 {
     $html = '';
     $servers = $this->server_factory->getAllServers();
     if (count($servers)) {
         $title_arr = array($GLOBALS['Language']->getText('admin_servers', 'all_name'), $GLOBALS['Language']->getText('admin_servers', 'all_description'), 'HTTP', 'HTTPS', $GLOBALS['Language']->getText('admin_servers', 'all_is_master'), '');
         $html .= html_build_list_table_top($title_arr);
         $row_num = 0;
         foreach ($servers as $key => $nop) {
             $html .= '<tr class="' . util_get_alt_row_color($row_num++) . '">';
             $html .= '<td><a title="' . $GLOBALS['Language']->getText('admin_servers', 'all_edit', array(htmlentities($servers[$key]->getName(), ENT_QUOTES, 'UTF-8'))) . '" href="/admin/servers/edit/' . $servers[$key]->getId() . '">' . $servers[$key]->getId() . '. ' . $servers[$key]->getName() . '</a></td>';
             $html .= '<td>' . $servers[$key]->getDescription() . '</td>';
             $html .= '<td>' . $servers[$key]->getHttp() . '</td>';
             $html .= '<td>' . $servers[$key]->getHttps() . '</td>';
             $html .= '<td style="text-align:center">' . ($servers[$key]->isMaster() ? $GLOBALS['Language']->getText('admin_servers', 'all_master') : '-') . '</td>';
             $html .= '<td>';
             if (!$servers[$key]->isMaster()) {
                 $html .= '<a title="' . $GLOBALS['Language']->getText('admin_servers', 'all_delete', array(htmlentities($servers[$key]->getName(), ENT_QUOTES, 'UTF-8'))) . '" href="/admin/servers/delete/' . $servers[$key]->getId() . '">' . $GLOBALS['Response']->getImage('ic/trash.png', array('alt' => 'Delete server')) . '</a>';
             } else {
                 $html .= '-';
             }
             $html .= '</td>';
             $html .= '</tr>';
         }
         $html .= '</table>';
     } else {
         $html .= '<p>No servers</p>';
     }
     $html .= '<p><a href="/admin/servers/add">' . $GLOBALS['Language']->getText('admin_servers', 'all_add') . '</a> ';
     if (count($servers)) {
         $html .= '| <a href="/admin/servers/master">' . $GLOBALS['Language']->getText('admin_servers', 'all_choose') . '</a>';
     }
     $html .= '</p>';
     return $html;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:35,代码来源:index.php


示例2: getContent

 function getContent()
 {
     $html_my_bookmarks = '';
     $result = db_query("SELECT bookmark_url, bookmark_title, bookmark_id from user_bookmarks where " . "user_id='" . user_getid() . "' ORDER BY bookmark_title");
     $rows = db_numrows($result);
     if (!$result || $rows < 1) {
         $html_my_bookmarks .= $GLOBALS['Language']->getText('my_index', 'no_bookmark');
         $html_my_bookmarks .= db_error();
     } else {
         $purifier = Codendi_HTMLPurifier::instance();
         $html_my_bookmarks .= '<table style="width:100%">';
         for ($i = 0; $i < $rows; $i++) {
             $bookmark_url = $purifier->purify(db_result($result, $i, 'bookmark_url'), CODENDI_PURIFIER_CONVERT_HTML);
             if (my_has_URL_invalid_content($bookmark_url)) {
                 $bookmark_url = '';
             }
             $bookmark_title = $purifier->purify(db_result($result, $i, 'bookmark_title'), CODENDI_PURIFIER_CONVERT_HTML);
             $html_my_bookmarks .= '<TR class="' . util_get_alt_row_color($i) . '"><TD>';
             $html_my_bookmarks .= '<A HREF="' . $bookmark_url . '">' . $bookmark_title . '</A> ';
             $html_my_bookmarks .= '<small><A HREF="/my/bookmark_edit.php?bookmark_id=' . db_result($result, $i, 'bookmark_id') . '">[' . $GLOBALS['Language']->getText('my_index', 'edit_link') . ']</A></SMALL></TD>';
             $html_my_bookmarks .= '<td style="text-align:right"><A HREF="/my/bookmark_delete.php?bookmark_id=' . db_result($result, $i, 'bookmark_id') . '">';
             $html_my_bookmarks .= '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" BORDER="0" ALT="DELETE"></A></td></tr>';
         }
         $html_my_bookmarks .= '</table>';
     }
     $html_my_bookmarks .= '<div style="text-align:center; font-size:0.8em;"><a href="/my/bookmark_add.php">[' . $GLOBALS['Language']->getText('my_index', 'add_bookmark') . ']</a></div>';
     return $html_my_bookmarks;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:28,代码来源:Widget_MyBookmarks.class.php


示例3: showParseResults

 /**
  * create the html output to visualize what has been parsed
  * @param $users: array containing all the users (User Object) that are in the import file
  */
 function showParseResults($parsed_users)
 {
     global $Language;
     echo $Language->getText('project_admin_userimport', 'ready') . "<br><br>\n";
     //Display table containing the list of users to be imported
     $title_arr = array($Language->getText('project_admin_userimport', 'username'), $Language->getText('project_admin_userimport', 'mail_addr'));
     echo html_build_list_table_top($title_arr);
     $i = 0;
     foreach ($parsed_users as $current_user) {
         echo '<TR class="' . util_get_alt_row_color($i++) . '">' . "\n";
         echo '<TD>' . $current_user->getName() . '</TD>' . "\n";
         echo '<TD>' . $current_user->getEmail() . '</TD></TR>' . "\n";
     }
     echo "</TABLE>\n";
     // Add 'import'  button to confirm import
     echo '<FORM NAME="acceptimportdata" action="?" method="POST" enctype="multipart/form-data">
         <p align="left"><INPUT TYPE="SUBMIT" NAME="submit" VALUE="' . $Language->getText('project_admin_userimport', 'import') . '"></p>
         <INPUT TYPE="HIDDEN" NAME="group_id" VALUE="' . $this->group_id . '">
         <INPUT TYPE="HIDDEN" NAME="func" VALUE="import">
         <INPUT TYPE="HIDDEN" NAME="mode" VALUE="import">';
     foreach ($parsed_users as $current_user) {
         echo '<INPUT TYPE="HIDDEN" NAME="parsed_users[]" VALUE="' . $current_user->getId() . '">';
     }
     echo '</FORM><A href="/project/admin/userimport.php?group_id=' . $this->group_id . '"> [' . $Language->getText('global', 'back') . ']</A>';
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:29,代码来源:UserImportHtml.class.php


示例4: getContent

 function getContent()
 {
     $html = '';
     $i = 1;
     $UH = UserHelper::instance();
     $hp = Codendi_HTMLPurifier::instance();
     while ($data = db_fetch_array($this->getLatestRevisions())) {
         $html .= '<div class="' . util_get_alt_row_color($i++) . '" style="border-bottom:1px solid #ddd">';
         $html .= '<div style="font-size:0.98em;">';
         $html .= '<a href="' . $this->_getLinkToCommit($data) . '">#' . $data['revision'] . '</a>';
         $html .= ' by ';
         if (isset($data['whoid'])) {
             $name = $UH->getDisplayNameFromUserId($data['whoid']);
         } else {
             $name = $UH->getDisplayNameFromUserName($data['who']);
         }
         $html .= $hp->purify($name, CODENDI_PURIFIER_CONVERT_HTML) . ' on ';
         //In the db, svn dates are stored as int whereas cvs dates are stored as timestamp
         $html .= format_date($GLOBALS['Language']->getText('system', 'datefmt'), is_numeric($data['date']) ? $data['date'] : strtotime($data['date']));
         $html .= '</div>';
         $html .= '<div style="padding-left:20px; padding-bottom:4px; color:#555">';
         $html .= util_make_links(substr($data['description'], 0, 255), $this->group_id);
         if (strlen($data['description']) > 255) {
             $html .= '&nbsp;[...]';
         }
         $html .= '</div>';
         $html .= '</div>';
     }
     $html .= '<div style="text-align:center" class="' . util_get_alt_row_color($i++) . '">';
     $html .= '<a href="' . $this->_getLinkToMore() . '">[ More ]</a>';
     $html .= '</div>';
     return $html;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:33,代码来源:Widget_ProjectLatestCommits.class.php


示例5: getContent

 function getContent()
 {
     $hp = Codendi_HTMLPurifier::instance();
     $content = '';
     if ($this->rss_url) {
         require_once 'common/rss/libs/SimplePie/simplepie.inc';
         if (!is_dir($GLOBALS['codendi_cache_dir'] . '/rss')) {
             mkdir($GLOBALS['codendi_cache_dir'] . '/rss');
         }
         $rss = new SimplePie($this->rss_url, $GLOBALS['codendi_cache_dir'] . '/rss', null, $GLOBALS['sys_proxy']);
         $max_items = 10;
         $items = array_slice($rss->get_items(), 0, $max_items);
         $content .= '<table width="100%">';
         $i = 0;
         foreach ($items as $item) {
             $content .= '<tr class="' . util_get_alt_row_color($i++) . '"><td WIDTH="99%">';
             if ($image = $item->get_link(0, 'image')) {
                 //hack to display twitter avatar
                 $content .= '<img src="' . $hp->purify($image, CODENDI_PURIFIER_CONVERT_HTML) . '" width="48" height="48" style="float:left; margin-right:1em;" />';
             }
             $content .= '<a href="' . $item->get_link() . '">' . $hp->purify($item->get_title(), CODENDI_PURIFIER_STRIP_HTML) . '</a>';
             if ($item->get_date()) {
                 $content .= '<span style="color:#999;" title="' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), $item->get_date('U')) . '"> - ' . DateHelper::timeAgoInWords($item->get_date('U')) . '</span>';
             }
             $content .= '</td></tr>';
         }
         $content .= '</table>';
     }
     return $content;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:30,代码来源:Widget_Rss.class.php


示例6: getContent

 function getContent()
 {
     $html_my_monitored_forums = '';
     $sql = "SELECT groups.group_id, groups.group_name " . "FROM groups,forum_group_list,forum_monitored_forums " . "WHERE groups.group_id=forum_group_list.group_id " . "AND groups.status = 'A' " . "AND forum_group_list.is_public <> 9 " . "AND forum_group_list.group_forum_id=forum_monitored_forums.forum_id " . "AND forum_monitored_forums.user_id='" . user_getid() . "' ";
     $um =& UserManager::instance();
     $current_user =& $um->getCurrentUser();
     if ($current_user->isRestricted()) {
         $projects = $current_user->getProjects();
         $sql .= "AND groups.group_id IN (" . implode(',', $projects) . ") ";
     }
     $sql .= "GROUP BY group_id ORDER BY group_id ASC LIMIT 100";
     $result = db_query($sql);
     $rows = db_numrows($result);
     if (!$result || $rows < 1) {
         $html_my_monitored_forums .= $GLOBALS['Language']->getText('my_index', 'my_forums_msg');
     } else {
         $request =& HTTPRequest::instance();
         $html_my_monitored_forums .= '<table style="width:100%">';
         for ($j = 0; $j < $rows; $j++) {
             $group_id = db_result($result, $j, 'group_id');
             $sql2 = "SELECT forum_group_list.group_forum_id,forum_group_list.forum_name " . "FROM groups,forum_group_list,forum_monitored_forums " . "WHERE groups.group_id=forum_group_list.group_id " . "AND groups.group_id={$group_id} " . "AND forum_group_list.is_public <> 9 " . "AND forum_group_list.group_forum_id=forum_monitored_forums.forum_id " . "AND forum_monitored_forums.user_id='" . user_getid() . "' LIMIT 100";
             $result2 = db_query($sql2);
             $rows2 = db_numrows($result2);
             $vItemId = new Valid_UInt('hide_item_id');
             $vItemId->required();
             if ($request->valid($vItemId)) {
                 $hide_item_id = $request->get('hide_item_id');
             } else {
                 $hide_item_id = null;
             }
             $vForum = new Valid_WhiteList('hide_forum', array(0, 1));
             $vForum->required();
             if ($request->valid($vForum)) {
                 $hide_forum = $request->get('hide_forum');
             } else {
                 $hide_forum = null;
             }
             list($hide_now, $count_diff, $hide_url) = my_hide_url('forum', $group_id, $hide_item_id, $rows2, $hide_forum);
             $html_hdr = ($j ? '<tr class="boxitem"><td colspan="2">' : '') . $hide_url . '<A HREF="/forum/?group_id=' . $group_id . '">' . db_result($result, $j, 'group_name') . '</A>&nbsp;&nbsp;&nbsp;&nbsp;';
             $html = '';
             $count_new = max(0, $count_diff);
             for ($i = 0; $i < $rows2; $i++) {
                 if (!$hide_now) {
                     $group_forum_id = db_result($result2, $i, 'group_forum_id');
                     $html .= '
                 <TR class="' . util_get_alt_row_color($i) . '"><TD WIDTH="99%">' . '&nbsp;&nbsp;&nbsp;-&nbsp;<A HREF="/forum/forum.php?forum_id=' . $group_forum_id . '">' . stripslashes(db_result($result2, $i, 'forum_name')) . '</A></TD>' . '<TD ALIGN="center"><A HREF="/my/stop_monitor.php?forum_id=' . $group_forum_id . '" onClick="return confirm(\'' . $GLOBALS['Language']->getText('my_index', 'stop_forum') . '\')">' . '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" ' . 'BORDER=0 ALT="' . $GLOBALS['Language']->getText('my_index', 'stop_monitor') . '"></A></TD></TR>';
                 }
             }
             $html_hdr .= my_item_count($rows2, $count_new) . '</td></tr>';
             $html_my_monitored_forums .= $html_hdr . $html;
         }
         $html_my_monitored_forums .= '</table>';
     }
     return $html_my_monitored_forums;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:55,代码来源:Widget_MyMonitoredForums.class.php


示例7: getContent

 function getContent()
 {
     $frsrf = new FRSReleaseFactory();
     $html_my_monitored_fp = '';
     $sql = "SELECT groups.group_name,groups.group_id " . "FROM groups,filemodule_monitor,frs_package " . "WHERE groups.group_id=frs_package.group_id " . "AND frs_package.status_id !=" . $frsrf->STATUS_DELETED . " " . "AND frs_package.package_id=filemodule_monitor.filemodule_id " . "AND filemodule_monitor.user_id='" . user_getid() . "' ";
     $um =& UserManager::instance();
     $current_user =& $um->getCurrentUser();
     if ($current_user->isRestricted()) {
         $projects = $current_user->getProjects();
         $sql .= "AND groups.group_id IN (" . implode(',', $projects) . ") ";
     }
     $sql .= "GROUP BY group_id ORDER BY group_id ASC LIMIT 100";
     $result = db_query($sql);
     $rows = db_numrows($result);
     if (!$result || $rows < 1) {
         $html_my_monitored_fp .= $GLOBALS['Language']->getText('my_index', 'my_files_msg');
     } else {
         $html_my_monitored_fp .= '<table style="width:100%">';
         $request =& HTTPRequest::instance();
         for ($j = 0; $j < $rows; $j++) {
             $group_id = db_result($result, $j, 'group_id');
             $sql2 = "SELECT frs_package.name,filemodule_monitor.filemodule_id " . "FROM groups,filemodule_monitor,frs_package " . "WHERE groups.group_id=frs_package.group_id " . "AND groups.group_id={$group_id} " . "AND frs_package.status_id !=" . $frsrf->STATUS_DELETED . " " . "AND frs_package.package_id=filemodule_monitor.filemodule_id " . "AND filemodule_monitor.user_id='" . user_getid() . "'  LIMIT 100";
             $result2 = db_query($sql2);
             $rows2 = db_numrows($result2);
             $vItemId = new Valid_UInt('hide_item_id');
             $vItemId->required();
             if ($request->valid($vItemId)) {
                 $hide_item_id = $request->get('hide_item_id');
             } else {
                 $hide_item_id = null;
             }
             $vFrs = new Valid_WhiteList('hide_frs', array(0, 1));
             $vFrs->required();
             if ($request->valid($vFrs)) {
                 $hide_frs = $request->get('hide_frs');
             } else {
                 $hide_frs = null;
             }
             list($hide_now, $count_diff, $hide_url) = my_hide_url('frs', $group_id, $hide_item_id, $rows2, $hide_frs);
             $html_hdr = ($j ? '<tr class="boxitem"><td colspan="2">' : '') . $hide_url . '<A HREF="/project/?group_id=' . $group_id . '">' . db_result($result, $j, 'group_name') . '</A>&nbsp;&nbsp;&nbsp;&nbsp;';
             $html = '';
             $count_new = max(0, $count_diff);
             for ($i = 0; $i < $rows2; $i++) {
                 if (!$hide_now) {
                     $html .= '
                     <TR class="' . util_get_alt_row_color($i) . '">' . '<TD WIDTH="99%">&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<A HREF="/file/showfiles.php?group_id=' . $group_id . '">' . db_result($result2, $i, 'name') . '</A></TD>' . '<TD><A HREF="/file/filemodule_monitor.php?filemodule_id=' . db_result($result2, $i, 'filemodule_id') . '&group_id=' . $group_id . '" onClick="return confirm(\'' . $GLOBALS['Language']->getText('my_index', 'stop_file') . '\')">' . '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" ' . 'BORDER=0" ALT="' . $GLOBALS['Language']->getText('my_index', 'stop_monitor') . '"></A></TD></TR>';
                 }
             }
             $html_hdr .= my_item_count($rows2, $count_new) . '</td></tr>';
             $html_my_monitored_fp .= $html_hdr . $html;
         }
         $html_my_monitored_fp .= '</table>';
     }
     return $html_my_monitored_fp;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:55,代码来源:Widget_MyMonitoredFp.class.php


示例8: getContent

 public function getContent()
 {
     $html = '';
     $uh = UserHelper::instance();
     $request = HTTPRequest::instance();
     $hp = Codendi_HTMLPurifier::instance();
     $user = UserManager::instance()->getCurrentUser();
     $pm = ProjectManager::instance();
     $project_ids = $user->getProjects();
     foreach ($project_ids as $project_id) {
         $project = $pm->getProject($project_id);
         if ($project->usesSVN()) {
             list($hide_now, $count_diff, $hide_url) = my_hide_url('my_svn_group', $project_id, $request->get('hide_item_id'), count($project_ids), $request->get('hide_my_svn_group'));
             $html .= $hide_url;
             $html .= '<strong>' . $project->getPublicName() . '</strong>';
             if (!$hide_now) {
                 list($latest_revisions, $nb_revisions) = svn_get_revisions($project, 0, $this->_nb_svn_commits, '', $user->getUserName(), '', '', 0, false);
                 if (db_numrows($latest_revisions) > 0) {
                     $i = 0;
                     while ($data = db_fetch_array($latest_revisions)) {
                         $html .= '<div class="' . util_get_alt_row_color($i++) . '" style="border-bottom:1px solid #ddd">';
                         $html .= '<div style="font-size:0.98em;">';
                         $html .= '<a href="' . $this->_getLinkToCommit($project->getGroupId(), $data['revision']) . '">rev #' . $data['revision'] . '</a>';
                         $html .= ' ' . $GLOBALS['Language']->getText('my_index', 'my_latest_svn_commit_on') . ' ';
                         //In the db, svn dates are stored as int whereas cvs dates are stored as timestamp
                         $html .= format_date($GLOBALS['Language']->getText('system', 'datefmt'), is_numeric($data['date']) ? $data['date'] : strtotime($data['date']));
                         $html .= ' ' . $GLOBALS['Language']->getText('my_index', 'my_latest_svn_commit_by') . ' ';
                         if (isset($data['whoid'])) {
                             $name = $uh->getDisplayNameFromUserId($data['whoid']);
                         } else {
                             $name = $uh->getDisplayNameFromUserName($data['who']);
                         }
                         $html .= $hp->purify($name, CODENDI_PURIFIER_CONVERT_HTML);
                         $html .= '</div>';
                         $html .= '<div style="padding-left:20px; padding-bottom:4px; color:#555">';
                         $html .= util_make_links(substr($data['description'], 0, 255), $project->getGroupId());
                         if (strlen($data['description']) > 255) {
                             $html .= '&nbsp;[...]';
                         }
                         $html .= '</div>';
                         $html .= '</div>';
                     }
                     $html .= '<div style="text-align:center" class="' . util_get_alt_row_color($i++) . '">';
                     $html .= '<a href="' . $this->_getLinkToMore($project->getGroupId(), $user->getUserName()) . '">[ More ]</a>';
                     $html .= '</div>';
                 } else {
                     $html .= '<div></div>';
                 }
             } else {
                 $html .= '<div></div>';
             }
         }
     }
     return $html;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:55,代码来源:Widget_MyLatestSvnCommits.class.php


示例9: getReferenceRow

function getReferenceRow($ref, $row_num)
{
    $html = '';
    if ($ref->isActive() && $ref->getId() != 100) {
        $html .= '<TR class="' . util_get_alt_row_color($row_num) . '">';
        $html .= '<TD>' . $ref->getKeyword() . '</TD>';
        $html .= '<TD>' . ReferenceAdministrationViews::getReferenceDescription($ref) . '</TD>';
        $html .= '<TD>' . $ref->getLink() . '</TD>';
        $html .= '</TR>';
    }
    return $html;
}
开发者ID:nterray,项目名称:tuleap,代码行数:12,代码来源:showdetails.php


示例10: getReferenceRow

function getReferenceRow($ref, $row_num)
{
    $html = '';
    if ($ref->isActive() && $ref->getId() != 100) {
        $purifier = Codendi_HTMLPurifier::instance();
        $html .= '<TR class="' . util_get_alt_row_color($row_num) . '">';
        $html .= '<TD>' . $purifier->purify($ref->getKeyword()) . '</TD>';
        $html .= '<TD>' . $purifier->purify(ReferenceAdministrationViews::getReferenceDescription($ref)) . '</TD>';
        $html .= '<TD>' . $purifier->purify($ref->getLink()) . '</TD>';
        $html .= '</TR>';
    }
    return $html;
}
开发者ID:rinodung,项目名称:tuleap,代码行数:13,代码来源:showdetails.php


示例11: snippet_show_package_snippets

function snippet_show_package_snippets($version)
{
    global $Language;
    $version = (int) $version;
    //show the latest version
    $sql = "SELECT snippet.snippet_id, snippet_package_item.snippet_version_id, snippet_version.version,snippet.name,user.user_name, snippet_version.filesize " . "FROM snippet,snippet_version,snippet_package_item,user " . "WHERE snippet.snippet_id=snippet_version.snippet_id " . "AND user.user_id=snippet_version.submitted_by " . "AND snippet_version.snippet_version_id=snippet_package_item.snippet_version_id " . "AND snippet_package_item.snippet_package_version_id='" . db_ei($version) . "'";
    $result = db_query($sql);
    $rows = db_numrows($result);
    echo '
	<P>
	<H3>' . $Language->getText('snippet_add_snippet_to_package', 's_in_p') . '</H3>
	<P>';
    $title_arr = array();
    $title_arr[] = $Language->getText('snippet_utils', 'version_id');
    $title_arr[] = $Language->getText('snippet_details', 's_version');
    $title_arr[] = $Language->getText('snippet_browse', 'title');
    $title_arr[] = $Language->getText('snippet_details', 'author');
    echo html_build_list_table_top($title_arr, $links_arr);
    if (!$result || $rows < 1) {
        echo db_error();
        echo '
			<TR><TD COLSPAN="4"><H3>' . $Language->getText('snippet_add_snippet_to_package', 'no_s_in_p') . '</H3></TD></TR>';
    } else {
        //get the newest version, so we can display it's code
        $newest_version = db_result($result, 0, 'snippet_version_id');
        for ($i = 0; $i < $rows; $i++) {
            echo '
			<TR class="' . util_get_alt_row_color($i) . '">
                            <TD><A HREF="/snippet/detail.php?type=snippet&id=' . db_result($result, $i, 'snippet_id') . '"><b><center>' . db_result($result, $i, 'snippet_version_id') . '</center></b></A></TD>
                            <TD>';
            echo '<A HREF="/snippet/download.php?type=snippet&id=' . db_result($result, $i, 'snippet_version_id') . '"><b><center>' . db_result($result, $i, 'version') . '</b></A>';
            // For uploaded files, the user can choose between view or display the code snippet
            if (db_result($result, $i, 'filesize') != 0) {
                // View link : the file is forced to be displayed as a text
                echo '&nbsp;<a href="/snippet/download.php?mode=view&type=snippet&id=' . db_result($result, $i, 'snippet_version_id') . '">';
                echo '<img src="' . util_get_image_theme("ic/view.png") . '" border="0" alt="' . $Language->getText('snippet_details', 'view') . '" title="' . $Language->getText('snippet_details', 'view') . '"></a>';
                // Download link : the file is forced to be downloaded
                echo '&nbsp;<a href="/snippet/download.php?mode=download&type=snippet&id=' . db_result($result, $i, 'snippet_version_id') . '">';
                echo '<img src="' . util_get_image_theme("ic/download.png") . '" border="0" alt="' . $Language->getText('snippet_details', 'download') . '" title="' . $Language->getText('snippet_details', 'download') . '"></a>';
            }
            $user = UserManager::instance()->getUserByUserName(db_result($result, $i, 'user_name'));
            echo '</center></TD>
                             <TD>' . db_result($result, $i, 'name') . '</TD><TD>' . UserHelper::instance()->getLinkOnUser($user) . '</TD></TR>';
        }
    }
    echo '</TABLE>';
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:47,代码来源:snippet_utils.php


示例12: displayAdminAllResponses

 protected function displayAdminAllResponses(TrackerManager $tracker_manager, $request, $current_user)
 {
     $hp = Codendi_HTMLPurifier::instance();
     $this->tracker->displayAdminItemHeader($tracker_manager, 'editcanned');
     //Display existing responses
     $responses = Tracker_CannedResponseFactory::instance()->getCannedResponses($this->tracker);
     if (count($responses)) {
         echo '<h3>' . $GLOBALS['Language']->getText('plugin_tracker_include_canned', 'existing_responses') . '</h3>';
         echo '<table cellspacing="0" cellpadding="4" border="0">';
         $i = 0;
         foreach ($responses as $response) {
             echo '<tr class="' . util_get_alt_row_color($i++) . '" valign="top">';
             //title
             echo '<td><a href="' . TRACKER_BASE_URL . '/?' . http_build_query(array('tracker' => (int) $this->tracker->id, 'func' => 'admin-canned', 'edit' => (int) $response->id)) . '">';
             echo '<strong>' . $hp->purify($response->title, CODENDI_PURIFIER_CONVERT_HTML) . '</strong></a>';
             //excerpt
             echo '<pre>' . $hp->purify(substr($response->body, 0, 160), CODENDI_PURIFIER_CONVERT_HTML);
             echo strlen($response->body) > 160 ? '<b>...</b>' : '';
             echo '</pre>';
             echo '</td>';
             //delete
             echo '<td><a href="' . TRACKER_BASE_URL . '/?' . http_build_query(array('tracker' => (int) $this->tracker->id, 'func' => 'admin-canned', 'delete' => (int) $response->id)) . '" 
                          onClick="return confirm(\'' . addslashes($GLOBALS['Language']->getText('plugin_tracker_include_canned', 'delete_canned', $response->title)) . '\')">';
             echo $GLOBALS['HTML']->getImage('ic/cross.png');
             echo '</a></td></tr>';
         }
         echo '</table>';
     } else {
         echo '<h3>' . $GLOBALS['Language']->getText('plugin_tracker_include_canned', 'no_canned_response') . '</h3>';
     }
     //Display creation form
     echo '<h3>' . $GLOBALS['Language']->getText('plugin_tracker_include_canned', 'create_response') . '</h3>';
     echo '<p>';
     echo $GLOBALS['Language']->getText('plugin_tracker_include_canned', 'save_time');
     echo '<p>';
     echo '<form action="' . TRACKER_BASE_URL . '/?' . http_build_query(array('tracker' => (int) $this->tracker->id, 'func' => 'admin-canned')) . '" 
                 method="POST">';
     echo '<b>' . $GLOBALS['Language']->getText('plugin_tracker_include_canned', 'title') . ':</b><br />';
     echo '<input type="text" name="title" value="" size="50">';
     echo '<p>';
     echo '<b>' . $GLOBALS['Language']->getText('plugin_tracker_include_canned', 'message_body') . '</b><br />';
     echo '<textarea name="body" rows="20" cols="65" wrap="hard"></textarea>';
     echo '<p>';
     echo '<input type="submit" name="create" value="' . $GLOBALS['Language']->getText('global', 'btn_submit') . '" />';
     echo '</from>';
     $this->tracker->displayFooter($tracker_manager);
 }
开发者ID:nterray,项目名称:tuleap,代码行数:47,代码来源:Tracker_CannedResponseManager.class.php


示例13: getContent

 function getContent()
 {
     $hp = Codendi_HTMLPurifier::instance();
     $content = '';
     if ($this->twitterfollow_user) {
         require_once 'common/rss/libs/SimplePie/simplepie.inc';
         if (!is_dir($GLOBALS['codendi_cache_dir'] . '/rss')) {
             mkdir($GLOBALS['codendi_cache_dir'] . '/rss');
         }
         $twitterfollow = new SimplePie($this->getFeedUrl($this->twitterfollow_user), $GLOBALS['codendi_cache_dir'] . '/rss', null, $GLOBALS['sys_proxy']);
         $max_items = 10;
         $items = array_slice($twitterfollow->get_items(), 0, $max_items);
         $content .= '<table width="100%">';
         $i = 0;
         foreach ($items as $i => $item) {
             $content .= '<tr class="' . util_get_alt_row_color($i++) . '"><td WIDTH="99%">';
             $content .= '<div style="float:right;">';
             $content .= '<a title="Reply" href="' . $this->getReplyToUrl($this->twitterfollow_user, basename($item->get_link())) . '">';
             $content .= $GLOBALS['HTML']->getImage('ic/twitter_reply.gif');
             $content .= '</a>';
             $content .= '</div>';
             $content .= '<span';
             if ($i == 1) {
                 $content .= ' style="font-size:1.5em">';
                 if ($image = $item->get_link(0, 'image')) {
                     //hack to display twitter avatar
                     $image = preg_replace('/_normal\\.(jpg|png|gif)$/i', '_bigger.$1', $image);
                     $content .= '<a href="http://twitter.com/' . urlencode($this->twitterfollow_user) . '">';
                     $content .= '<img src="' . $hp->purify($image, CODENDI_PURIFIER_CONVERT_HTML) . '" width="48" height="48" style="float:left; margin-right:1em;" />';
                     $content .= '</a>';
                 }
             } else {
                 $content .= '>';
                 //end of <span
             }
             $content .= $item->get_title();
             //Trust SimplePie for purifying
             if ($item->get_date()) {
                 $content .= ' <span style="color:#999; white-space:nowrap;" title="' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), $item->get_date('U')) . '">- ' . DateHelper::timeAgoInWords($item->get_date('U')) . '</span>';
             }
             $content .= '</span>';
             $content .= '</td></tr>';
         }
         $content .= '</table>';
     }
     return $content;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:47,代码来源:Widget_TwitterFollow.class.php


示例14: format_html_row

function format_html_row($row, &$row_num)
{
    echo "<tr class=\"" . util_get_alt_row_color($row_num++) . "\">\n";
    foreach ($row as $cell) {
        $htmlattrs = '';
        $value = '';
        if (is_array($cell)) {
            if (isset($cell['value'])) {
                $value = $cell['value'];
            }
            if (isset($cell['html_attrs'])) {
                $htmlattrs = ' ' . $cell['html_attrs'];
            }
        } else {
            $value = $cell;
        }
        echo '  <td>' . $value . "</td>\n";
    }
    echo "</tr>\n";
}
开发者ID:nterray,项目名称:tuleap,代码行数:20,代码来源:ugroup.php


示例15: showAvailableReports

 function showAvailableReports()
 {
     $hp = Codendi_HTMLPurifier::instance();
     $g = $GLOBALS['ath']->getGroup();
     $group_id = $g->getID();
     $atid = $GLOBALS['ath']->getID();
     $reports = $this->grf->getReports_ids();
     echo '<H2>' . $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'tracker') . ' \'<a href="/tracker/admin/?group_id=' . $group_id . '&atid=' . $atid . '">' . $hp->purify($GLOBALS['ath']->getName()) . '</a>\'' . $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'report_admin') . '</H2>';
     if ($reports) {
         // Loop through the list of all graphic reports
         $title_arr = array();
         $title_arr[] = $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'report_name');
         $title_arr[] = $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'desc');
         $title_arr[] = $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'scope');
         $title_arr[] = $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'delete');
         echo '<p>' . $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'mod');
         echo html_build_list_table_top($title_arr);
         for ($i = 0; $i < count($reports); $i++) {
             $r = new GraphOnTrackers_Report($reports[$i]);
             echo '<TR class="' . util_get_alt_row_color($i) . '"><TD>';
             if ($r->getScope() == 'S' || !$GLOBALS['ath']->userIsAdmin() && $r->getScope() == 'P') {
                 echo $hp->purify($r->getName());
             } else {
                 echo '<A HREF="/tracker/admin/?func=reportgraphic&group_id=' . $group_id . '&report_graphic_id=' . $r->getId() . '&atid=' . $GLOBALS['ath']->getID() . '">' . $hp->purify($r->getName()) . '</A>';
             }
             echo "</td>" . "\n<td>" . $hp->purify($r->getDescription(), CODENDI_PURIFIER_BASIC) . '</td>' . "\n<td align=\"center\">" . $hp->purify($r->getScopeLabel($r->getScope())) . '</td>' . "\n<td align=\"center\">";
             if ($r->getScope() == 'S' || !$GLOBALS['ath']->userIsAdmin() && $r->getScope() == 'P') {
                 echo '-';
             } else {
                 $delete_report_text = $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'delete_report', $r->getName());
                 $delete_report_text_js = $hp->purify($delete_report_text, CODENDI_PURIFIER_JS_QUOTE);
                 echo '<A HREF="/tracker/admin/?func=reportgraphic' . '&report_graphic_id=' . $r->getId() . '&group_id=' . $group_id . '&atid=' . $atid . '&delete_report_graphic=1"' . '" onClick="return confirm(\'' . $delete_report_text_js . '\')">' . '<img src="' . util_get_image_theme("ic/trash.png") . '" border="0"></A>';
             }
             echo '</td></tr>';
         }
         echo '</TABLE>';
     } else {
         echo '<p><h3>' . $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'no_rep_def') . '</h3>';
     }
     echo '<P> ' . $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'create_report', array('/tracker/admin/?func=reportgraphic&group_id=' . $group_id . '&atid=' . $atid . '&new_report_graphic=1'));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:41,代码来源:GraphicEngineHtml.class.php


示例16: showInverseDependencies

 /**
  * Display the artifact inverse dependencies list
  *
  * @param group_id: the group id
  * @param group_artifact_id: the artifact type ID
  * @param ascii: ascii mode
  *
  * @return void
  */
 function showInverseDependencies($group_id, $group_artifact_id, $ascii = false)
 {
     $hp = Codendi_HTMLPurifier::instance();
     global $sys_lf, $Language;
     //
     //      format the dependencies list for this artifact
     //
     $result = $this->getInverseDependencies();
     $rows = db_numrows($result);
     $out = '';
     // Nobody in the dependencies list -> return now
     if ($rows <= 0) {
         if ($ascii) {
             $out = $Language->getText('tracker_include_artifact', 'no_depend') . "{$sys_lf}";
         } else {
             $out = '<H4>' . $Language->getText('tracker_include_artifact', 'no_depend') . '</H4>';
         }
         return $out;
     }
     // Header first an determine what the print out format is
     // based on output type (Ascii, HTML)
     if ($ascii) {
         $out .= $Language->getText('tracker_include_artifact', 'dep_list') . $sys_lf . str_repeat("*", strlen($Language->getText('tracker_include_artifact', 'dep_list'))) . "{$sys_lf}{$sys_lf}";
         $fmt = "%-15s | %s (%s){$sys_lf}";
         $out .= sprintf($fmt, $Language->getText('tracker_include_artifact', 'artifact'), $Language->getText('tracker_include_artifact', 'summary'), $Language->getText('global', 'status'));
         $out .= "------------------------------------------------------------------{$sys_lf}";
     } else {
         $title_arr = array();
         $title_arr[] = $Language->getText('tracker_include_artifact', 'artifact');
         $title_arr[] = $Language->getText('tracker_include_artifact', 'summary');
         $title_arr[] = $Language->getText('global', 'status');
         $title_arr[] = $Language->getText('tracker_import_admin', 'tracker');
         $title_arr[] = $Language->getText('tracker_include_artifact', 'group');
         $out .= html_build_list_table_top($title_arr);
         $fmt = "\n" . '<TR class="%s"><td>%s</td><td>%s</td><td align="center">%s</td>' . '<td align="center">%s</td><td align="center">%s</td></tr>';
     }
     // Loop through the denpendencies and format them
     for ($i = 0; $i < $rows; $i++) {
         $dependent_on_artifact_id = db_result($result, $i, 'artifact_id');
         $summary = db_result($result, $i, 'summary');
         $status = db_result($result, $i, 'status');
         $tracker_label = db_result($result, $i, 'name');
         $group_label = db_result($result, $i, 'group_name');
         if ($ascii) {
             $out .= sprintf($fmt, $dependent_on_artifact_id, $summary, $status);
         } else {
             $out .= sprintf($fmt, util_get_alt_row_color($i), '<a href="/tracker/?func=gotoid&group_id=' . (int) $group_id . '&aid=' . (int) $dependent_on_artifact_id . '">' . (int) $dependent_on_artifact_id . '</a>', $hp->purify(util_unconvert_htmlspecialchars($summary), CODENDI_PURIFIER_CONVERT_HTML), $hp->purify($status, CODENDI_PURIFIER_CONVERT_HTML), $hp->purify(SimpleSanitizer::unsanitize($tracker_label), CODENDI_PURIFIER_CONVERT_HTML), $hp->purify(util_unconvert_htmlspecialchars($group_label), CODENDI_PURIFIER_CONVERT_HTML));
         }
         // for
     }
     // final touch...
     $out .= $ascii ? "{$sys_lf}" : "</TABLE>";
     return $out;
 }

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP util_get_dir_image_theme函数代码示例发布时间:2022-05-23
下一篇:
PHP util_getRootPath函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap