Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 1: <?php
 2: /**
 3:  * A class to render helpful information next to a form element
 4:  *
 5:  * @package Core
 6:  * @subpackage GUI
 7:  * @version SVN Revision $Rev:$
 8:  *
 9:  * @author Mischa Holz
10:  * @copyright four for business AG <www.4fb.de>
11:  * @license http://www.contenido.org/license/LIZENZ.txt
12:  * @link http://www.4fb.de
13:  * @link http://www.contenido.org
14:  */
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16: 
17: /**
18:  * Class cGuilBackendHelpbox.
19:  * Renders a little helpbox to display information next to a form element
20:  *
21:  * @package Core
22:  * @subpackage GUI
23:  */
24: class cGuiBackendHelpbox {
25: 
26:     /**
27:      * the text that will appear in the tooltip
28:      *
29:      * @var string
30:      */
31:     protected $helpText;
32: 
33:     protected $imageURL;
34: 
35:     /**
36:      * Basic constructor.
37:      * Assigns a help text
38:      *
39:      * @param string $helpText the text that will appear in the tooltip
40:      * @param string $imageURL This image will be used for the tooltip
41:      */
42:     public function __construct($helpText, $imageURL = '') {
43:         $this->setHelpText($helpText);
44:         $this->setImageURL($imageURL);
45:     }
46: 
47:     /**
48:      * Set the help text to a new value
49:      *
50:      * @param string $helpText the text that will appear in the tooltip
51:      */
52:     public function setHelpText($helpText) {
53:         $this->helpText = $helpText;
54:     }
55: 
56:     /**
57:      * Set the image for the tooltip
58:      *
59:      * @param string $imageURL the image file
60:      */
61:     public function setImageURL($imageURL) {
62:         $this->imageURL = $imageURL;
63:     }
64: 
65:     /**
66:      * Render the helpbox.
67:      * Please make sure that the atooltip.jquery.js and the
68:      * atooltip.css are embedded on the site
69:      *
70:      * @param string $returnAsString if true the rendered button will be
71:      *        returned. Otherwise it will be echoed
72:      * @return string|NULL rendered button or nothing if it's been printed
73:      */
74:     public function render($returnAsString = true) {
75:         $id = md5(rand()) . "-Info";
76: 
77:         $style = '';
78:         if ($this->imageURL != '') {
79:             $style = 'style="background: transparent url(' . $this->imageURL . ') no-repeat;"';
80:         }
81: 
82:         $ret = "<a " . $style . " href='javascript://' id='" . $id . "-link' title='" . i18n("More information") . "' class='i-link infoButton'></a>";
83:         $ret .= "<div id='" . $id . "' style='display: none;'>" . $this->helpText . "</div>";
84: 
85:         if ($returnAsString) {
86:             return $ret;
87:         } else {
88:             echo ($ret);
89:             return NULL;
90:         }
91:     }
92: }
93: 
94: ?>
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen