本文整理汇总了PHP中gpOutput类的典型用法代码示例。如果您正苦于以下问题:PHP gpOutput类的具体用法?PHP gpOutput怎么用?PHP gpOutput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了gpOutput类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ShowRecent
function ShowRecent()
{
global $langmessage;
$page->css_admin[] = '/include/css/addons.css';
//for hmargin css pre gpEasy 3.6
echo '<h2 class="hmargin">';
$label = gpOutput::SelectText('Blog');
echo common::Link('Special_Blog', $label);
echo ' » ';
echo common::Link('Admin_Blog', $langmessage['configuration']);
echo ' <span>|</span> ';
echo common::Link('Admin_BlogCategories', 'Categories');
echo ' <span>|</span> ';
echo gpOutput::SelectText('Comments');
echo '</h2>';
echo '<table style="width:100%" class="bordered">';
echo '<tr><th>';
echo 'Comment';
echo '</th><th>';
echo 'Time / Website';
echo '</th><th>';
echo 'Options';
echo '</th></tr>';
uasort($this->cache, array('SimpleBlogComments', 'Sort'));
foreach ($this->cache as $comment) {
$this->OutputComment($comment);
}
echo '</table>';
}
开发者ID:Knuzen,项目名称:gpEasy-CMS,代码行数:29,代码来源:AdminComments.php
示例2: Run
/**
* Print all categories and their contents on gadget
*
*/
function Run()
{
echo '<div class="simple_blog_gadget"><div>';
echo '<span class="simple_blog_gadget_label">';
echo gpOutput::GetAddonText('Categories');
echo '</span>';
echo '<ul>';
foreach ($this->categories as $catdata) {
if (!$catdata['visible']) {
continue;
//skip hidden categories
}
echo '<li>';
$sum = count($catdata['posts']);
echo '<a class="blog_gadget_link">' . $catdata['ct'] . ' (' . $sum . ')</a>';
if ($sum) {
echo '<ul class="nodisplay">';
foreach ($catdata['posts'] as $post_index => $post_title) {
echo '<li>';
echo common::Link('Special_Blog', $post_title, 'id=' . $post_index);
echo '</li>';
}
echo '</ul>';
}
echo '</li>';
}
echo '</ul>';
echo '</div></div>';
}
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:33,代码来源:CategoriesGadget.php
示例3: Check
function Check($passed)
{
$message = gpOutput::SelectText('Sorry, your answer to the verification challenge was incorrect. Please try again.');
if (empty($_POST['asm_1']) || empty($_POST['asm_2']) || empty($_POST['asm_3'])) {
message($message . ' (1)');
return false;
}
$operator_key = $_POST['asm_2'];
if (!isset($this->operators[$operator_key])) {
message($message . ' (2)');
return false;
}
switch ($operator_key) {
case 1:
$result = $_POST['asm_1'] + $_POST['asm_3'];
break;
case 2:
$result = $_POST['asm_1'] - $_POST['asm_3'];
break;
case 3:
$result = $_POST['asm_1'] / $_POST['asm_3'];
break;
case 4:
$result = $_POST['asm_1'] * $_POST['asm_3'];
break;
}
$compare = $_POST['asm_4'];
//message('result: '.$result.' vs submitted: '.$compare);
if ($compare != $result) {
message($message . ' (3)');
return false;
}
//message('passed');
return $passed;
}
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:35,代码来源:AntiSpamMath.php
示例4: UpdateOutputTest
/**
* Very rough integration test of the updater
* Passes if no errors are thrown
* Also defines $page for subsequent tests
*
*/
function UpdateOutputTest()
{
global $page;
ob_start();
includeFile('tool/update.php');
$page = new update_class();
gpOutput::HeadContent();
includeFile('install/template.php');
ob_get_clean();
}
开发者ID:jozefkrz,项目名称:gpEasy-CMS,代码行数:16,代码来源:UpdateTest.php
示例5: EditGalleries
function EditGalleries()
{
global $page, $langmessage;
$page->head_js[] = '/include/js/special_galleries.js';
$page->css_admin[] = '/include/css/edit_gallery.css';
echo '<h2>';
echo common::Link('Special_Galleries', gpOutput::ReturnText('galleries'));
echo ' » ' . $langmessage['administration'];
echo '</h2>';
echo '<p>';
echo $langmessage['DRAG-N-DROP-DESC2'];
echo '</p>';
$this->EditableArea();
}
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:14,代码来源:admin_galleries.php
示例6: GetContent
function GetContent()
{
$this->GetGpxContent();
if (!empty($this->non_admin_content)) {
echo '<div class="filetype-text cf">';
//echo '<div id="gpx_content" class="filetype-text">'; //id="gpx_content" conflicts with admin content
echo $this->non_admin_content;
echo '</div>';
}
echo '<div id="gpAfterContent">';
gpOutput::Get('AfterContent');
gpPlugin::Action('GetContent_After');
echo '</div>';
}
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:14,代码来源:admin_display.php
示例7: Response
/**
* Handle HTTP responses made with $_REQUEST['req'] = json (when <a ... data-cmd="gpajax">)
* Sends JSON object to client
*
*/
static function Response()
{
global $page;
if (!is_array($page->ajaxReplace)) {
die;
}
if (!isset($_REQUEST['jsoncallback'])) {
die('Invalid Request: jsoncallback not set');
}
//gadgets may be using gpajax/json request/responses
gpOutput::TemplateSettings();
gpOutput::PrepGadgetContent();
echo gpAjax::Callback($_REQUEST['jsoncallback']);
echo '([';
//output content
if (!empty($_REQUEST['gpx_content'])) {
switch ($_REQUEST['gpx_content']) {
case 'gpabox':
gpAjax::JsonDo('admin_box_data', '', $page->contentBuffer);
break;
}
} elseif (in_array('#gpx_content', $page->ajaxReplace)) {
$replace_id = '#gpx_content';
if (isset($_GET['gpreqarea'])) {
$replace_id = '#' . $_GET['gpreqarea'];
}
ob_start();
$page->GetGpxContent(true);
$content = ob_get_clean();
gpAjax::JsonDo('replace', $replace_id, $content);
}
//other areas
foreach ($page->ajaxReplace as $arguments) {
if (is_array($arguments)) {
$arguments += array(0 => '', 1 => '', 2 => '');
gpAjax::JsonDo($arguments[0], $arguments[1], $arguments[2]);
}
}
//always send messages
ob_start();
echo GetMessages(false);
$content = ob_get_clean();
if (!empty($content)) {
gpAjax::JsonDo('messages', '', $content);
}
echo ']);';
die;
}
开发者ID:jozefkrz,项目名称:gpEasy-CMS,代码行数:53,代码来源:ajax.php
示例8: Heading
/**
* @param string $current
*/
function Heading($current)
{
global $langmessage;
$options = array('Admin_Blog' => 'Posts', 'Admin_BlogConfig' => $langmessage['configuration'], 'Admin_BlogCategories' => 'Categories', 'Admin_BlogComments' => gpOutput::SelectText('Comments'));
$links = array();
foreach ($options as $slug => $label) {
if ($slug == $current) {
$links[] = $label;
} else {
$links[] = common::Link($slug, $label);
}
}
echo common::Link('Admin_Blog', 'New Blog Post', 'cmd=new_form', ' class="gpsubmit" style="float:right"');
echo '<h2 class="hmargin">';
$label = gpOutput::SelectText('Blog');
echo common::Link('Special_Blog', $label);
echo ' » ';
echo implode('<span>|</span>', $links);
echo '</h2>';
}
开发者ID:Typesetter,项目名称:Simple-Blog,代码行数:23,代码来源:Admin.php
示例9: special_map
function special_map()
{
global $page, $langmessage, $config;
/*
An xml site map will not show any of the pages from dynamic add-ons
... which is precisely what the regular sitemap shows
*/
if (isset($_GET['xml'])) {
$this->xml();
return;
}
$this->MultiSiteData();
echo '<div class="sitemap_xml">';
echo common::Link('Special_Site_Map', 'XML', 'xml');
echo '</div>';
echo '<h2>';
echo gpOutput::ReturnText('site_map');
echo '</h2>';
gpOutput::GetFullMenu();
}
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:20,代码来源:special_map.php
示例10: Upgrade_234
/**
* Update the gp_index, gp_titles and menus so that special pages can be renamed
*
*/
function Upgrade_234()
{
global $gp_index, $gp_titles, $gp_menu, $config, $dataDir;
includeFile('tool/gpOutput.php');
$special_indexes = array();
$new_index = array();
$new_titles = array();
foreach ($gp_index as $title => $index) {
$info = $gp_titles[$index];
$type = common::SpecialOrAdmin($title);
if ($type === 'special') {
$special_indexes[$index] = strtolower($title);
$index = strtolower($title);
$info['type'] = 'special';
//some older versions didn't maintain this value well
}
$new_index[$title] = $index;
$new_titles[$index] = $info;
}
$gp_titles = $new_titles;
$gp_index = $new_index;
//update gp_menu
$gp_menu = $this->FixMenu($gp_menu, $special_indexes);
//save pages
if (!admin_tools::SavePagesPHP()) {
return;
}
$config['gpversion'] = '2.3.4';
admin_tools::SaveConfig();
//update alt menus
if (isset($config['menus']) && is_array($config['menus'])) {
foreach ($config['menus'] as $key => $value) {
$menu_file = $dataDir . '/data/_menus/' . $key . '.php';
if (gpFiles::Exists($menu_file)) {
$menu = gpOutput::GetMenuArray($key);
$menu = $this->FixMenu($menu, $special_indexes);
gpFiles::SaveData($menu_file, 'menu', $menu);
}
}
}
}
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:45,代码来源:upgrade.php
示例11: Run
/**
* Print all archives and their contents on gadget
*
*/
function Run()
{
if (!count($this->archives)) {
return;
}
echo '<div class="simple_blog_gadget"><div>';
echo '<span class="simple_blog_gadget_label">';
echo gpOutput::GetAddonText('Archives');
echo '</span>';
$prev_year = false;
echo '<ul>';
foreach ($this->archives as $ym => $posts) {
$y = floor($ym / 100);
$m = $ym % 100;
if ($y != $prev_year) {
if ($prev_year !== false) {
echo '</li>';
}
echo '<li><div class="simple_blog_gadget_year">' . $y . '</div>';
$prev_year = $y;
}
$sum = count($posts);
if (!$sum) {
continue;
}
echo '<ul>';
echo '<li><a class="blog_gadget_link">' . $this->months[$m - 1] . ' (' . $sum . ')</a>';
echo '<ul class="simple_blog_category_posts nodisplay">';
foreach ($posts as $post_index => $post_title) {
echo '<li>';
echo common::Link('Special_Blog', $post_title, 'id=' . $post_index);
echo '</li>';
}
echo '</ul>';
echo '</li>';
echo '</ul>';
}
echo '</li></ul>';
echo '</div></div>';
}
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:44,代码来源:ArchivesGadget.php
示例12: ShowCategories
function ShowCategories()
{
echo '<h2>';
echo gpOutput::GetAddonText('Categories');
echo '</h2>';
//$gadgetFile = $this->addonPathData.'/gadget_categories.php';
echo '<ul>';
foreach ($this->categories as $catindex => $catname) {
//skip hidden categories
if (SimpleBlogCommon::AStrValue('categories_hidden', $catindex)) {
continue;
}
$cat_posts_str =& SimpleBlogCommon::$data['category_posts_' . $catindex];
$count = substr_count($cat_posts_str, '>');
if (!$count) {
continue;
}
echo '<li>';
echo SimpleBlogCommon::CategoryLink($catindex, $catname, $catname . ' (' . $count . ')');
echo '</li>';
}
echo '</ul>';
}
开发者ID:GedionChang,项目名称:gpEasy-CMS,代码行数:23,代码来源:SimpleBlogCategories.php
示例13: SimpleBlogCategories
function SimpleBlogCategories()
{
global $addonPathData;
SimpleBlogCommon::AddCSS();
$gadget_file = $addonPathData . '/gadget_categories.php';
$content = '';
if (file_exists($gadget_file)) {
$content = file_get_contents($gadget_file);
}
//fix edit links
if (strpos($content, 'simple_blog_gadget_label')) {
new SimpleBlogCommon();
$content = file_get_contents($gadget_file);
}
if (empty($content)) {
return;
}
echo '<div class="simple_blog_gadget"><div>';
echo '<span class="simple_blog_gadget_label">';
echo gpOutput::GetAddonText('Categories');
echo '</span>';
echo $content;
echo '</div></div>';
}
开发者ID:GedionChang,项目名称:gpEasy-CMS,代码行数:24,代码来源:CategoriesGadget.php
示例14: GetAdminLink
function GetAdminLink()
{
trigger_error('deprecated functions');
gpOutput::GetAdminLink();
}
开发者ID:jozefkrz,项目名称:gpEasy-CMS,代码行数:5,代码来源:display.php
示例15: GetNoMenus
/**
* Get an array of titles that is not represented in any of the menus
*
*/
function GetNoMenus()
{
global $gp_index;
//first get all titles in a menu
$menus = $this->GetAvailMenus('menu');
$all_keys = array();
foreach ($menus as $menu_id => $label) {
$menu_array = gpOutput::GetMenuArray($menu_id);
$keys = array_keys($menu_array);
$all_keys = array_merge($all_keys, $keys);
}
$all_keys = array_unique($all_keys);
//then check $gp_index agains $all_keys
foreach ($gp_index as $title => $index) {
if (in_array($index, $all_keys)) {
continue;
}
$avail[] = $title;
}
return $avail;
}
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:25,代码来源:admin_menu_new.php
示例16: ExecInfo
static function ExecInfo($scriptinfo)
{
global $dataDir;
ob_start();
gpOutput::ExecInfo($scriptinfo);
return ob_get_clean();
}
开发者ID:Knuzen,项目名称:gpEasy-CMS,代码行数:7,代码来源:special.php
示例17: CacheLess
/**
* Convert a .less file to .css and include it in the page
* @param mixed $less_files A strin or array of less filesThe absolute or relative path of the .less file
*
*/
static function CacheLess($less_files)
{
global $dataDir;
//generage the name of the css file from the modified times and content length of each imported less file
$files_hash = common::ArrayHash($less_files);
$list_file = $dataDir . '/data/_cache/less_' . $files_hash . '.list';
if (file_exists($list_file)) {
$list = explode("\n", file_get_contents($list_file));
//pop the etag
$etag = array_pop($list);
if (!ctype_alnum($etag)) {
$list[] = $etag;
$etag = false;
}
// generate an etag if needed or if logged in
if (!$etag || common::LoggedIn()) {
$etag = common::FilesEtag($list);
}
$compiled_name = 'less_' . $files_hash . '_' . $etag . '.css';
$compiled_file = '/data/_cache/' . $compiled_name;
if (file_exists($dataDir . $compiled_file)) {
//msg('not using cache');
return $compiled_file;
}
}
$less_files = (array) $less_files;
$compiled = gpOutput::ParseLess($less_files, $files_hash);
if (!$compiled) {
return false;
}
// generate the file name
$etag = common::FilesEtag($less_files);
$compiled_name = 'less_' . $files_hash . '_' . $etag . '.css';
$compiled_file = '/data/_cache/' . $compiled_name;
// save the cache
// use the last line for the etag
$less_files[] = $etag;
$cache = implode("\n", $less_files);
if (!gpFiles::Save($list_file, $cache)) {
return false;
}
//save the css
if (file_put_contents($dataDir . $compiled_file, $compiled)) {
return $compiled_file;
}
return false;
}
开发者ID:Bomberus,项目名称:gpEasy-CMS,代码行数:52,代码来源:gpOutput.php
示例18: SectionEdit
/**
* Perform various section editing commands
*
*/
function SectionEdit($cmd)
{
global $page, $langmessage;
if (empty($_REQUEST['file'])) {
message($langmessage['OOPS']);
return false;
}
$page->ajaxReplace = array();
$file = gp_edit::CleanTitle($_REQUEST['file']);
$data = gpOutput::ExtraContent($file, $file_stats);
$page->file_sections = array($data);
//hack so the SaveSection filter works
$page->file_stats = $file_stats;
if (!gp_edit::SectionEdit($cmd, $data, 0, '', $file_stats)) {
return;
}
//save the new content
$file_full = $this->folder . '/' . $file . '.php';
if (!gpFiles::SaveData($file_full, 'extra_content', $data)) {
message($langmessage['OOPS']);
$this->EditExtra();
return false;
}
$page->ajaxReplace[] = array('ck_saved', '', '');
message($langmessage['SAVED']);
$this->areas[$file] = $file;
$this->EditExtra();
return true;
}
开发者ID:GedionChang,项目名称:gpEasy-CMS,代码行数:33,代码来源:admin_extra.php
示例19: AddContent
/**
* Insert new content into a layout
*
*/
function AddContent()
{
global $langmessage, $page;
//for ajax responses
$page->ajaxReplace = array();
if (!isset($_REQUEST['where'])) {
message($langmessage['OOPS']);
return false;
}
//prep destination
if (!$this->GetValues($_REQUEST['where'], $to_container, $to_gpOutCmd)) {
message($langmessage['OOPS'] . ' (Insert location not found)');
return false;
}
$handlers = $this->GetAllHandlers();
$this->PrepContainerHandlers($handlers, $to_container, $to_gpOutCmd);
//figure out what we're inserting
$addtype =& $_REQUEST['addtype'];
switch ($_REQUEST['addtype']) {
case 'new_extra':
$extra_name = $this->NewExtraArea();
if ($extra_name === false) {
message($langmessage['OOPS'] . '(2)');
return false;
}
$insert = 'Extra:' . $extra_name;
break;
case 'custom_menu':
$insert = $this->NewCustomMenu();
break;
case 'preset_menu':
$insert = $this->NewPresetMenu();
break;
default:
$insert = $_REQUEST['insert'];
break;
}
if (!$insert) {
message($langmessage['OOPS'] . ' (Nothing to insert)');
return false;
}
//new info
$new_gpOutInfo = gpOutput::GetgpOutInfo($insert);
if (!$new_gpOutInfo) {
message($langmessage['OOPS'] . ' (Nothing to insert)');
return false;
}
$new_gpOutCmd = rtrim($new_gpOutInfo['key'] . ':' . $new_gpOutInfo['arg'], ':');
if (!$this->AddToContainer($handlers[$to_container], $to_gpOutCmd, $new_gpOutCmd, false)) {
return false;
}
$this->SaveHandlersNew($handlers);
return true;
}
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:58,代码来源:admin_theme_content.php
示例20: SimpleSearch
function SimpleSearch()
{
global $page, $langmessage, $addonPathData;
$this->config_file = $addonPathData . '/search_config.php';
$this->GetConfig();
if (common::LoggedIn()) {
$page->admin_links[] = array('Special_Search', 'Configuration', 'cmd=config');
$cmd = common::GetCommand();
switch ($cmd) {
case 'save_config':
if ($this->SaveConfig()) {
break;
}
return;
case 'config':
$this->Config($this->search_config);
return;
}
}
$query =& $_GET['q'];
echo '<div class="search_results">';
echo '<form action="' . common::GetUrl('Special_Search') . '" method="get">';
echo '<h2>';
echo gpOutput::GetAddonText('Search');
echo ' ';
echo '<input name="q" type="text" class="text" value="' . htmlspecialchars($query) . '"/>';
echo '<input type="hidden" name="src" value="gadget" /> ';
$html = '<input type="submit" name="" class="submit" value="%s" />';
echo gpOutput::GetAddonText('Search', $html);
echo '</h2>';
echo '</form>';
if (!empty($query)) {
$query = strtolower($query);
preg_match_all("/\\S+/", $query, $words);
$words = array_unique($words[0]);
$pattern = '#(';
$bar = '';
foreach ($words as $word) {
$pattern .= $bar . preg_quote($word, '#');
$bar = '|';
}
$pattern .= ')#Si';
$this->SearchPages($pattern);
$this->SearchBlog($pattern);
}
if (count($this->files) > 0) {
foreach ($this->files as $result) {
echo $result;
}
} else {
echo '<p>';
echo gpOutput::GetAddonText('Sorry, there weren\'t any results for your search. ');
echo '</p>';
}
echo '</div>';
}
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:56,代码来源:SimpleSearch.php
注:本文中的gpOutput类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论