/** * Singleton * @return object */ public static function getInstance() { if (!isset(self::$_instance) && !self::$_instance instanceof auth_lenauth_out) { self::$_instance = new self(); } return self::$_instance; }
<?php require '../../config.php'; if (has_capability('moodle/user:update', context_system::instance())) { if (required_param('style', PARAM_TEXT)) { $style = format_string($_GET['style']); global $CFG; include_once $CFG->dirroot . '/auth/lenauth/out.php'; echo 'Static inline HTML code:<br /><pre>' . htmlspecialchars(auth_lenauth_out::getInstance()->lenauth_output($style, false, true), ENT_QUOTES) . '</pre>'; } else { throw new moodle_exception('style GET-parameter is not set', 'auth_lenauth'); } } else { throw new moodle_exception('You do not have permissions', 'auth_lenauth'); }
?> </th> <th width="60%"><?php echo get_string('auth_lenauth_output_php_code_key', 'auth_lenauth'); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->_styles_array as $style_item) { ?> <tr> <td> <?php echo auth_lenauth_out::getInstance()->lenauth_output($style_item, true); ?> <br /><em><?php echo $style_item; ?> </em> <?php switch ($style_item) { case 'bootstrap-font-awesome': echo '<br /><small style="color:red">' . get_string('auth_lenauth_bootstrap_fontawesome_needle', 'auth_lenauth') . '</small>'; break; } ?> </td> <td> <code><?php if ( file_exists( $CFG->dirroot . '/auth/lenauth/out.php' ) ) :<br />include_once $CFG->dirroot . '/auth/lenauth/out.php';<br />echo auth_lenauth_out::getInstance()->lenauth_output('<?php