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

PHP WebPage类代码示例

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

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



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

示例1: Display

 /**
  * Get the HTML fragment corresponding to the HTML editor widget
  * @param WebPage $oP The web page used for all the output
  * @param Hash $aArgs Extra context arguments
  * @return string The HTML fragment to be inserted into the page
  */
 public function Display(WebPage $oPage, $aArgs = array())
 {
     $iId = $this->m_iId;
     $sCode = $this->m_sAttCode . $this->m_sNameSuffix;
     $sValue = $this->m_sValue;
     $sHelpText = $this->m_sHelpText;
     $sValidationField = $this->m_sValidationField;
     $sHtmlValue = "<table><tr><td><textarea class=\"htmlEditor\" title=\"{$sHelpText}\" name=\"attr_{$this->m_sFieldPrefix}{$sCode}\" rows=\"10\" cols=\"10\" id=\"{$iId}\">{$sValue}</textarea></td><td>{$sValidationField}</td></tr></table>";
     // Replace the text area with CKEditor
     // To change the default settings of the editor,
     // a) edit the file /js/ckeditor/config.js
     // b) or override some of the configuration settings, using the second parameter of ckeditor()
     $sLanguage = strtolower(trim(UserRights::GetUserLanguage()));
     $oPage->add_ready_script("\$('#{$iId}').ckeditor(function() { /* callback code */ }, { language : '{$sLanguage}' , contentsLanguage : '{$sLanguage}', extraPlugins: 'disabler' });");
     // Transform $iId into a CKEdit
     // Please read...
     // ValidateCKEditField triggers a timer... calling itself indefinitely
     // This design was the quickest way to achieve the field validation (only checking if the field is blank)
     // because the ckeditor does not fire events like "change" or "keyup", etc.
     // See http://dev.ckeditor.com/ticket/900 => won't fix
     // The most relevant solution would be to implement a plugin to CKEdit, and handle the internal events like: setData, insertHtml, insertElement, loadSnapshot, key, afterUndo, afterRedo
     // Could also be bound to 'instanceReady.ckeditor'
     $oPage->add_ready_script("\$('#{$iId}').bind('validate', function(evt, sFormId) { return ValidateCKEditField('{$iId}', '', {$this->m_sMandatory}, sFormId, '') } );\n");
     $oPage->add_ready_script("\$('#{$iId}').bind('update', function() { BlockField('cke_{$iId}', \$('#{$iId}').attr('disabled')); } );\n");
     return $sHtmlValue;
 }
开发者ID:henryavila,项目名称:itop,代码行数:32,代码来源:ui.htmleditorwidget.class.inc.php


示例2: DisplayWelcomePopup

/**
 * Displays a popup welcome message, once per session at maximum
 * until the user unchecks the "Display welcome at startup"
 * @param WebPage $oP The current web page for the display
 * @return void
 */
function DisplayWelcomePopup(WebPage $oP)
{
    if (!isset($_SESSION['welcome'])) {
        // Check, only once per session, if the popup should be displayed...
        // If the user did not already ask for hiding it forever
        $bPopup = appUserPreferences::GetPref('welcome_popup', true);
        if ($bPopup) {
            $sTemplate = @file_get_contents('../application/templates/welcome_popup.html');
            if ($sTemplate !== false) {
                $oTemplate = new DisplayTemplate($sTemplate);
                $oP->add("<div id=\"welcome_popup\">");
                $oTemplate->Render($oP, array());
                $oP->add("<p style=\"float:left\"><input type=\"checkbox\" checked id=\"display_welcome_popup\"/><label for=\"display_welcome_popup\">&nbsp;" . Dict::S('UI:DisplayThisMessageAtStartup') . "</label></p>\n");
                $oP->add("<p style=\"float:right\"><input type=\"button\" value=\"" . Dict::S('UI:Button:Ok') . "\" onClick=\"\$('#welcome_popup').dialog('close');\"/>\n");
                $oP->add("</div>\n");
                $sTitle = addslashes(Dict::S('UI:WelcomeMenu:Title'));
                $oP->add_ready_script(<<<EOF
\t\$('#welcome_popup').dialog( { width:'80%', height: 'auto', title: '{$sTitle}', autoOpen: true, modal:true,
\t\t\t\t\t\t\t\t  close: function() {
\t\t\t\t\t\t\t\t  \tvar bDisplay = \$('#display_welcome_popup:checked').length;
\t\t\t\t\t\t\t\t  \tSetUserPreference('welcome_popup', bDisplay, true); 
\t\t\t\t\t\t\t\t  }
\t\t\t\t\t\t\t\t  });
\tif (\$('#welcome_popup').height() > (\$(window).height()-70))
\t{
\t\t\$('#welcome_popup').height(\$(window).height()-70);
\t}
EOF
);
                $_SESSION['welcome'] = 'ok';
            }
        }
    }
}
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:40,代码来源:UI.php


示例3: create

 /**
  * @test
  */
 public function create()
 {
     $model = new WebPage();
     $model->attributes = array('title' => 'test', 'name' => "test", 'description' => "description test", 'keywords' => "test");
     $this->assertTrue($model->save());
     $model = new WebPage();
     $model->attributes = array('title' => 'testa', 'name' => "test");
     $this->assertFalse($model->save());
     $this->assertInstanceOf('WebPage', WebPage::model());
 }
开发者ID:ChristopheBrun,项目名称:hLib,代码行数:13,代码来源:WebPageTest.php


示例4: test_should_find_by_id_string

 public function test_should_find_by_id_string()
 {
     $attributes = array('title' => 'UserMinds.com');
     $UserMinds = $this->WebPage->create($attributes);
     $FoundUserMinds = new WebPage((string) $UserMinds->getId());
     $this->assertFalse($FoundUserMinds->isNewRecord());
     $this->assertEqual($FoundUserMinds->getId(), $UserMinds->getId());
     $FoundUserMinds = $UserMinds->find((string) $UserMinds->getId());
     $this->assertFalse($FoundUserMinds->isNewRecord());
     $this->assertEqual($FoundUserMinds->getId(), $UserMinds->getId());
 }
开发者ID:bermi,项目名称:akelos,代码行数:11,代码来源:finders.php


示例5: __construct

 /**
  * @param string $url
  * @param string $tmpDir
  * @param string $viewportSize
  * @param int $zoomFactor
  * @param int $timeout
  * @param int $delay
  * @throws \Exception
  */
 public function __construct($url, $tmpDir = '/tmp', $viewportSize = WebPage::SIZE_NETBOOK_15, $zoomFactor = 1, $timeout = 0, $delay = 0)
 {
     if (!is_dir($tmpDir) || !is_writable($tmpDir)) {
         throw new \Exception("Destination dir '{$tmpDir}' must exist and be writable");
     }
     do {
         $tmpFile = $tmpDir . '/' . uniqid() . '.png';
     } while (file_exists($tmpFile));
     $webPage = new WebPage($url);
     $webPage->getShot($tmpFile, $viewportSize, $zoomFactor, $timeout, $delay);
     $this->image = imagecreatefrompng($tmpFile);
     unlink($tmpFile);
     $this->sourceWidth = imagesx($this->image);
     $this->sourceHeight = imagesy($this->image);
 }
开发者ID:codegyre,项目名称:phantomshot,代码行数:24,代码来源:ThumbnailCollector.php


示例6: __construct

	function __construct()
	{
		parent::WebPage('StackOverflow 5672167');
		$nav = new Panel(0, 0, 600, 30);
		$chat = new Panel(0, $nav->Bottom, 200, 500);
		$content = new MarkupRegion('', $chat->Right, $chat->Top, 400, 350);
		$rooms = new Panel($content->Left, $content->Bottom, 400, 150);
		$footer = new Panel(0, $chat->Bottom, 600, 50);
		
		$chat->BackColor = Color::LightGreen;
		$content->BackColor = Color::Yellow;
		$rooms->BackColor = Color::Orange;
		$footer->BackColor = Color::Gray;
		
		$this->Controls->AddRange($nav, $chat, $content, $rooms, $footer);
		
		$sections = array('HOME', 'ABOUT', 'CONTACT', 'LOGIN');
			
		foreach($sections as $section)
			$nav->Controls->Add(new Link(null, $section, 0, 5))
				->Click = new ServerEvent($this, 'LoadSection', $content, $section);
				
		$nav->Controls->AllCSSMarginRight = '5px';
		$nav->Controls->AllLayout = Layout::Relative;
		$nav->CSSTextAlign = 'right';
		//Comet (Listener), Bind to Yahoo Flickr API through YQL
		$this->Controls->Add($listener = new Listener(
			'http://query.yahooapis.com/v1/public/yql?q=select%20source%20from%20flickr.photos.sizes%20WHERE%20photo_id%20in%20(select%20id%20from%20flickr.photos.recent)%20and%20label%3D%22Thumbnail%22',
			new ServerEvent($this, 'LoadImage', $chat)));
			
		//Default Section
		$this->LoadSection($content, URL::GetToken('section', 'HOME'));
	}
开发者ID:noloh,项目名称:StackOverflow-Answer--Basic-Site-Example,代码行数:33,代码来源:index.php


示例7: basePageHref

function basePageHref($basePageCode, $image)
{
    $basePage = WebPage::inst($basePageCode);
    $sprites = CssSpritesManager::getDirSprite(CssSpritesManager::DIR_HEADER, $image, true);
    $href = $basePage->getHref($sprites . $basePage->getName());
    echo PsHtml::html2('li', array('class' => WebPages::getCurPage()->isMyBasePage($basePage) ? 'current' : null), $href);
}
开发者ID:ilivanoff,项目名称:www,代码行数:7,代码来源:function.header_links.php


示例8: __construct

	function __construct()
	{
		parent::WebPage('Basic TinyMCE Example 1');
		$this->Controls->Add($editor = new TinyMCE('Testing'));
		$this->Controls->Add($button = new Button('Click Me', $editor->Right + 10))
			->Click = new ServerEvent($this, 'SomeFunc', $editor);
	}
开发者ID:noloh,项目名称:TinyMCE,代码行数:7,代码来源:Example1.php


示例9: CKEditorTest

 function CKEditorTest()
 {
     parent::WebPage('CKEditor Example');
     //Instantiate first CKEditor
     $editor1 = new CKEditor('', 10, 40);
     //Instantiate second CKEditor
     $editor2 = new CKEditor('Text that is already entered', $editor1->Right + 10, 40, 300);
     //Set the second CKEditor's Skin to Office theme
     //		$editor2->Skin = CKEditor::Office;
     //Instantiate third CKEditor
     $editor3 = new CKEditor('Text that is already entered', $editor2->Right + 50, 40);
     //Set the third CKEditor's Skin to V2 theme
     //		$editor3->Skin = CKEditor::V2;
     //Adds the 3 Editors to the WebPage
     $this->Controls->AddRange($editor1, $editor2, $editor3);
     /*For each of the above 3 editors we're going to add a ComboBox above
     		the editor that allows you to change the theme and a button that will switch
     		the CKEditor to the Basic/Advanced Toolbar*/
     foreach ($this->Controls as $control) {
         if ($control instanceof CKEditor) {
             $this->Controls->Add($skins = new ComboBox($control->Left, 5, 150));
             $skins->Items->AddRange(new Item('-- Select Theme --', null), CKEditor::Kama, CKEditor::Office, CKEditor::V2);
             $skins->Change = new ServerEvent($this, 'ChangeSkin', $skins, $control);
             //Button to switch to Basic Toolbar
             $this->Controls->Add($basic = new Button('Basic', $skins->Right + 15, 5))->Click = new ServerEvent($control, 'SetToolbar', CKEditor::Basic);
             //Button to switch to Advanced Toolbar
             $this->Controls->Add(new Button('Advanced', $basic->Right + 10, 5))->Click = new ServerEvent($control, 'SetToolbar', CKEditor::Full);
             $this->Controls->Add($ta = new TextArea('', $control->Left, $control->Bottom + 10, $control->Width))->Click = new ServerEvent($this, 'ShowText', $control, $ta);
         }
     }
 }
开发者ID:noloh,项目名称:CKEditor,代码行数:31,代码来源:index.php


示例10: __construct

 public function __construct(Identifier $page)
 {
     if (!$page->of(WebPage::getIdentifier())) {
         throw new \InvalidArgumentException(sprintf('RestartRequestOnPageException expects a web page identifier, %s given.', $page->getFullyQualifiedName()));
     }
     $this->page = $page;
     parent::__construct('RestartRequestOnPageException');
 }
开发者ID:picon,项目名称:picon-framework,代码行数:8,代码来源:RestartRequestOnPageException.php


示例11: SetHttpHeaders

 public function SetHttpHeaders(WebPage $oPage)
 {
     // Integration within MS-Excel web queries + HTTPS + IIS:
     // MS-IIS set these header values with no-cache... while Excel fails to do the job if using HTTPS
     // Then the fix is to force the reset of header values Pragma and Cache-control
     $oPage->add_header("Pragma:", true);
     $oPage->add_header("Cache-control:", true);
 }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:8,代码来源:spreadsheetbulkexport.class.inc.php


示例12: __construct

 public function __construct(Identifier $pageIdentifier, Identifier $loginPage)
 {
     Args::identifierOf($pageIdentifier, WebPage::getIdentifier(), 'pageIdentifier');
     Args::identifierOf($loginPage, WebPage::getIdentifier(), 'loginPage');
     $this->pageAuthIdentifier = $pageIdentifier;
     $this->loginPageIdentifier = $loginPage;
     PiconApplication::get()->getSecuritySettings()->setComponentNotAuthorisedListener(new DirectToPageComponentNotAuthorisedListener($loginPage));
 }
开发者ID:picon,项目名称:picon-framework,代码行数:8,代码来源:AbstractPageClassAuthorisationStrategy.php


示例13: __construct

 public function __construct($title, $showCover = true, $hrefOrPageCode = null, array $smartyParams = array(), $jsParams = null)
 {
     $this->title = $title;
     $this->cover = !!$showCover;
     $this->href = is_numeric($hrefOrPageCode) ? WebPage::inst($hrefOrPageCode)->getUrl() : $hrefOrPageCode;
     $this->smartyParams = $smartyParams;
     $this->jsParams = $jsParams;
 }
开发者ID:ilivanoff,项目名称:www,代码行数:8,代码来源:ClientBoxFilling.php


示例14: Save

	function Save($editor)
	{
		$comment = $editor->Text;
		$editor->Leave();
		$this->Controls->Clear();
		$this->Controls->Add(new MarkupRegion($comment, 0, 0, '100%', '100%'));
		WebPage::That()->Controls->Add(new BlogComment())	
			->Layout = Layout::Relative;
	}
开发者ID:noloh,项目名称:TinyMCE,代码行数:9,代码来源:Example3.php


示例15: HighlighterTest

 function HighlighterTest()
 {
     parent::WebPage('Syntax Highlighter Example');
     /*Instantiate new SyntaxHighlighter pointing to file code.txt, 
     		using PHP, with  a location of 0, 0, and a Size of null, null*/
     $highlighter = new SyntaxHighlighter('code.txt', SyntaxHighlighter::PHP, 0, 0, null, null);
     //Add SyntaxHighlighter to the WebPage
     $this->Controls->Add($highlighter);
 }
开发者ID:noloh,项目名称:SyntaxHighlighter,代码行数:9,代码来源:index.php


示例16: ClickCounter

 /**
  * Constructor
  */
 function ClickCounter()
 {
     parent::WebPage('Classic Click Counter');
     //Instantiate Button with left and top of 100
     $button = new Button('Click Me', 100, 100, null, null);
     //Set Click Event of $button. Triggers CountClick with $button as param
     $button->Click = new ServerEvent($this, 'CountClick', $button);
     //Adds the button to show
     $this->Controls->Add($button);
 }
开发者ID:noloh,项目名称:ClickCounter,代码行数:13,代码来源:index.php


示例17: Events

 function Events()
 {
     /* Calls the WebPage's constructor. This must be done to
        ensure that WebPage is properly instantiated. The 
        parameter specifies a string to be displayed in the
        browser's title bar. */
     parent::WebPage('Demonstrating basic Events');
     // Calls the CreateButton function, which is defined below
     $this->CreateButton();
 }
开发者ID:noloh,项目名称:Basic-Events,代码行数:10,代码来源:Events.php


示例18: __construct

 function __construct()
 {
     parent::WebPage('FullCalendar Example 1');
     $this->Controls->Add($calendar = new FullCalendar(array(FullCalendar::Month, FullCalendar::AgendaDay), 100, 100));
     // Create Button to Add Events
     $this->Controls->Add(new Button('Add'))->Click = new ServerEvent($this, 'AddEventFunc', $calendar);
     // Setting Events on the Calendar
     $calendar->DayClick = new ServerEvent($this, "DayFunc");
     $calendar->EventClick = new ServerEvent($this, "EventFunc");
 }
开发者ID:noloh,项目名称:FullCalendar,代码行数:10,代码来源:Example1.php


示例19: EmailExample3

 function EmailExample3()
 {
     parent::WebPage('EmailHelper Example 3');
     //Basic Example
     EmailHelper::Email('[email protected]', '[email protected]', 'EmailHelper Basic', 'Some Test Message');
     //Message
     //Advanced Example
     EmailHelper::Email(array('[email protected]', '[email protected]'), array('[email protected]', '[email protected]', '[email protected]'), 'EmailHelper Advanced', array('Some Message', '<b>Some Message</b>'));
     //RichMessage
 }
开发者ID:noloh,项目名称:EmailHelper,代码行数:10,代码来源:EmailExample3.php


示例20: doProcess

 protected function doProcess(PageContext $ctxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams)
 {
     $this->PPM = PopupPagesManager::inst();
     //Проверим, что в случае открытия popup страницы все параметры переданы корректно
     if (!$this->PPM->isValidPageRequested()) {
         WebPage::inst(PAGE_POPUP)->redirectHere();
     }
     $this->popupPage = $this->PPM->getCurPage();
     $this->popupPage->checkAccess();
     $this->popupPage->doProcess($requestParams);
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:11,代码来源:popup.php



注:本文中的WebPage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP WebRequest类代码示例发布时间:2022-05-23
下一篇:
PHP WebModule类代码示例发布时间: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