本文整理汇总了PHP中gpPlugin::incl方法的典型用法代码示例。如果您正苦于以下问题:PHP gpPlugin::incl方法的具体用法?PHP gpPlugin::incl怎么用?PHP gpPlugin::incl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpPlugin
的用法示例。
在下文中一共展示了gpPlugin::incl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Example_Ajax
function Example_Ajax()
{
global $page, $addonRelativeCode;
//prepare the page
$page->head_js[] = $addonRelativeCode . 'static/02_script.js';
$page->admin_js = true;
//get request parameters and execute any commands
$string = '';
if (isset($_REQUEST['string'])) {
$string = $_REQUEST['string'];
}
$cmd = common::GetCommand();
switch ($cmd) {
case 'randomstring':
$string = common::RandomString(10);
break;
}
//display the form
echo '<h2>Example Ajax Requests</h2>';
echo '<form method="post" action="' . $page->title . '">';
echo 'Text: <input type="text" name="string" value="' . htmlspecialchars($string) . '" size="30" />';
echo ' <input type="submit" class="gpajax" value="Post Form Asynchronosly" /> ';
echo common::Link($page->title, 'Get Random String', 'cmd=randomstring', 'name="gpajax"');
echo '</form>';
//output the $_REQUEST variable
echo '<h3>Request</h3>';
echo showArray($_REQUEST);
//plugin example navigation
gpPlugin::incl('navigation.php');
PluginExampleNavigation();
}
示例2: Example_Map
function Example_Map()
{
global $page, $addonRelativeCode;
//add css and js to <head>
$page->head .= '<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />';
$page->head .= '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=en"></script>';
$page->head .= '<script type="text/javascript" src="' . $addonRelativeCode . '/static/01_script.js"></script>';
//html contents of the page
echo '<h2>Display a Google Map With Directions</h2>';
echo '<div id="input">';
echo '<input id="map_address" type="textbox" value="starting point" />';
echo '<input type="button" value="calculate route" id="calc_route_button" />';
echo '</div>';
echo '<div id="directionsPanel" style="float:right;width:300px;"></div>';
echo '<div id="map_canvas" style="width:500px;height:500px;"></div>';
//plugin example navigation
gpPlugin::incl('navigation.php');
PluginExampleNavigation();
}
示例3: defined
<?php
defined('is_running') or die('Not an entry point...');
gpPlugin::incl('SimpleBlogCommon.php', 'require_once');
class 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>';
}
}
示例4: defined
<?php
defined('is_running') or die('Not an entry point...');
gpPlugin::incl('PageProtect.php');
class AdminProtect extends PageProtect
{
function AdminProtect()
{
global $gp_menu;
$this->PageProtect();
echo '<h2>';
echo common::Link('Admin_Protect', 'Protected Pages');
echo '</h2>';
$cmd = common::GetCommand();
switch ($cmd) {
case 'savecontent':
$this->SaveContent();
case 'editcontent':
$this->EditContent();
return;
}
echo '<p>';
echo '<b>' . common::Link('Admin_Protect', 'Protected Content', 'cmd=editcontent') . '</b> ';
echo 'Edit the content users will see if they navigate to a protected page and aren\'t logged in.';
echo '</p>';
if (!count($this->config['pages'])) {
echo '<p>There aren\'t any protected pages.</p>';
return;
}
echo '<table class="bordered">';
echo '<tr><th>Pages</th><th>Child Pages</th></tr>';
示例5: inc
/**
* Alias of gpPlugin::incl()
*/
function inc($file)
{
return gpPlugin::incl($file);
}
示例6: OnTextChange
function OnTextChange()
{
gpPlugin::incl('SimpleBlogCommon.php', 'require_once');
new SimpleBlogCommon();
//regenerate the gadget and feed
}