Exemple #1
0
 /**
  * Retrieves markup/code of databrowser to be embedded in view.
  *
  * @return string markup/code of databrowser
  */
 public function getCode()
 {
     // get items to render in databrowser
     try {
         $this->processInput();
         $items = $this->getItems();
     } catch (\RuntimeException $e) {
         return markup::paragraph(markup::emphasize(_L('Failed to query datasource for listing items.')));
     }
     // render table including related pager widget
     if (count($items)) {
         // fetch form to use optionally
         $form = $this->getForm();
         $volatiles = _A(config::get('databrowser.volatiles', array()))->elements;
         $available = input::listNames();
         foreach ($volatiles as $volatile) {
             if (in_array($volatile, $available)) {
                 $form->setHidden($volatile, input::vget($volatile));
             }
         }
         // split items into raw data and additionally delivered data per row
         $rows = $extras = array();
         foreach ($items as $key => $row) {
             $rows[$key] = $row;
             unset($rows[$key]['|extra']);
             $extras[$key] = $row['|extra'];
         }
         // use local callback to wrap custom cell formatter for enriching
         // with additional data per row
         $browser = $this;
         $cellFormatter = function ($value, $name, $item, $id) use($browser, $extras) {
             return $browser->formatCell($value, $name, $item, $id, $extras[$id]);
         };
         // render table view
         $id = $form ? null : $this->datasource->name();
         $table = html::arrayToTable($rows, $id, $cellFormatter, array(&$this, 'formatHeader'), '', '', $this->className);
         $code = $this->pager . $table;
         // wrap rendered table view in form
         if ($form && !$this->callerForm) {
             $code = (string) $form->addContent($code);
         }
         // return code of rendered databrowser
         return $code;
     }
     $text = $this->emptyText ? $this->emptyText : _L('There is no data to be listed here ...');
     return markup::paragraph(markup::emphasize($text), trim($this->className . ' empty-text'));
 }
Exemple #2
0
    public function testXmlConversionReverseConsistency()
    {
        $data = base64_encode(serialize(_A('1', 5, 'test', null, false)));
        $kak_tebja_sawut = "Как тебя зовут?";
        $source = <<<EOT
<?xml version="1.0" encoding="utf-8"?>
<root>
 <messages>
  <message>
   <en>Hello World!</en>
   <de>Hallo Welt!</de>
  </message>
  <message>
   <en>What's your name?</en>
   <de>Wie heißt du?</de>
   <ru>{$kak_tebja_sawut}</ru>
  </message>
  <message/>
 </messages>
 <data>=?8bit?B?{$data}?=</data>
</root>
EOT;
        $this->assertEquals($source, trim(set::fromXml($source)->toXml()->saveXML()));
    }
Exemple #3
0
<?php

_JS('scaleimage');
?>

<?php 
foreach ($content['notes'] as $note) {
    _X('note-pre');
    ?>
<article>
	<h3 class="article-name"><?php 
    echo _A('<a href="' . $note['href'] . '">' . $note['title'] . '</a>');
    ?>
</h3>
	<div class="article-menu">
		<?php 
    if (array_key_exists('favourite-toggle-href', $note)) {
        ?>
		<a href="<?php 
        echo $note['favourite-toggle-href'];
        ?>
" class="e2-favourite-toggle">
		<img src="<?php 
        echo _IMGSRC('star-' . ($note['favourite?'] ? 'set' : 'unset') . '.png');
        ?>
" alt="Избранное" title="Избранное"
		/></a>
		
		<?php 
    } else {
        ?>
Exemple #4
0
_E($ROOT);
?>
"><?php 
_E(strtolower(GLOBAL_TITLE));
?>
</a></h1>
				<nav id="navigation">
					<ul>
						<li><a<?php 
_A('front');
?>
 href="<?php 
_E($ROOT);
?>
">About</a></li>
						<li><a<?php 
_A('help');
?>
 href="<?php 
_E($ROOT);
?>
help">Help</a></li>
					</ul>
				</nav>
			</div><!-- #wrapper -->
			<hr />
		</div><!-- #branding -->
		
		<div id="content">
			<div class="wrapper">
				
Exemple #5
0
 /**
  * Will load the module language. This method will require_once every LANGUAGE definition of a module so as to have a simple
  * way of pre-loading the necessary CONSTANTS for our modules;
  *
  * @param S $modNameOrDir The name of the registered module
  * @return void Doesn't need to return anything
  * @author Catalin Z. Alexandru <*****@*****.**>
  * @copyright Under the terms of the GNU General Public License v3
  * @version $Id: 15_MOD.php 314 2009-10-09 14:24:35Z catalin.zamfir $
  * @since Version 1.0
  * @access protected
  * @static
  */
 protected static function requireLanguage(FilePath $modNameOrDir)
 {
     // At first, CLEAR the LANGUAGE cache ...
     if (self::getSessionVar(new S('language')) != LANGUAGE) {
         // Make it the NEW, and empty the old;
         unset($_SESSION[PROJECT_NAME]['RA_mod_lng'][$modNameOrDir->toString()]);
         self::setSessionVar(new S('language'), new O(LANGUAGE));
     }
     // Include ALL files in LANGUAGE_DIR, so we can speak some english;
     $scannedModuleDirectory = new FileDirectory(self::$objRegisteredModules[$modNameOrDir]['dir'] . _S . LANGUAGE_DIR . _S . self::getSessionVar(new S('language')));
     if (!isset($_SESSION[PROJECT_NAME]['RA_mod_lng'][$modNameOrDir->toString()])) {
         // We need to order LANG_FILES, just for the sake of humanity;
         $_SESSION[PROJECT_NAME]['RA_mod_lng'][$modNameOrDir->toString()]['scandir'] = $scannedModuleDirectory->scanDirectory($_SESSION[PROJECT_NAME]['RA_mod_lng'][$modNameOrDir->toString()]['f_count']);
     }
     // Do the FOR;
     foreach ($_SESSION[PROJECT_NAME]['RA_mod_lng'][$modNameOrDir->toString()]['scandir'] as $k => $v) {
         // Check the extension, to be PHP (cause we store other crap in LANG) ...
         if (_A(pathinfo($v))->offsetGet('extension') == 'php') {
             // Leave out .directories and .files;
             require_once $scannedModuleDirectory . _S . $v;
         }
     }
 }
Exemple #6
0
    ?>
</div>

</div>

<?php 
}
_Q("I get an error message about DDRAW.DLL.");
_A("Please ensure you have downloaded and installed Microsoft DirectX 7.0 or later. You can download it from the Microsoft site.");
_Q("I get an error message about FMOD.DLL.");
_A("Please ensure you have unzipped the ZIP file in a directory before launching the executable. As of 2008-10-18 with release 1.4, we don't use the FMOD library any longer. However, this could also happen with other DLL files on Windows.");
_Q("(When) Will you add network support?");
_A("Thibaut already started adding some code, but this task is currently suspended. Thibaut doesn't have time to implement this and Bernd doesn't have the knowledge.");
_Q("How do I make joysticks work?");
_A("You have to plug in the joystick(s) to your machine, install it within Windows, ensure Windows can read the joystick(s) state. Finally, launch the game, and you will be able to select JOYSTICK1, JOYSTICK2, and so on, according to the number of joysticks you have.");
_Q("My computer beeps when there are too many keys pressed on the keyboard.");
_A("This is a known bug. In fact, it depends if your keyboard's hardware supports a lot of keys pressed at once. Generally USB and PS2 keyboards are OK with this. Older keyboards generally can't have a lot of keys pressed together.");
_Q("Sometimes the bombers don't accept moving commands.");
_A("This could happen if too many keys are pressed on the keyboard at the same time. In fact, it depends if your keyboard's hardware supports a lot of keys pressed at once. Generally USB and PS2 keyboards are OK with this. Older keyboards generally can't have a lot of keys pressed together.");
_Q("I've found a bug. Are you interested?");
_A("Yes, we are. Please report bugs to the [[http://sourceforge.net/tracker/?func=browse&group_id=81520&atid=563210 bug tracker at sourceforge.net]] by submitting a new tracker item.");
_Q("I start Bombermaaan, but I don't get any windows. Additionally, I don't see a running Bombermaaan task in the task manager. The file log.txt exists and was changed just a few seconds ago.");
_A("Maybe Bombermaaan encountered an error and quit. The log file is created and updated by Bombermaaan. You will find the log.txt file in the same directory where the Bombermaaan.exe file resides. You can check this file by yourself and/or open a support request item at the [[http://sourceforge.net/tracker/?group_id=81520&atid=563211 sourceforge.net support tracker]].");
_Q("I start Bombermaaan, but I don't get any opening windows. Additionally, I don't see a running Bombermaaan task in the task manager. There is no file called log.txt in the folder where Bombermaaan.exe resides.");
_A("This could happen when the needed DLLs are missing. This could also happen if the wrong DLLs are used. Please have a look into the Windows event viewer. The system section may report an application popup event (event id 26).");
?>

</div>

<?php 
$webpage->tail();
Exemple #7
0
 /**
  * Extends current set by provided set(s).
  *
  * @note This method is actually adjusting set managed by current instance.
  *
  * @return set extended set
  */
 public function extend()
 {
     $extensions = func_get_args();
     foreach ($extensions as $extension) {
         if ($extension instanceof self) {
             $this->data = array_merge_recursive($this->data, $extension->data);
         } else {
             $this->data = array_merge_recursive($this->data, _A($extension)->data);
         }
     }
     return $this;
 }
Exemple #8
0
 /**
  * Will return an unique hash, based on the newly available hash_* functions in PHP, imported from PECL. It's a way to have
  * a secure mechanism for defining clear, unique hashing algorithms. For example, we recommend and soon started using the SHA-2
  * hashing mechanism for our own unique hashes. If the hash algorithm wasn't defined in PHP, the script will output a screen of
  * death, mainly due to the fact that hashing, as a concept is quite important for encryption, uniqueness and content checks;
  * <code>
  * <?php
  * 		// Return an unique HASH;
  *		echo EXE::getUniqueHash (new S ('sha256'), new S ('Data as a string'));
  * ?>
  * </code>
  *
  * @param S $objHashAlgo The hash algorithm
  * @param S $objStringData The data to process
  * @return S The hash, as a string that can be further processed
  * @author Catalin Z. Alexandru <*****@*****.**>
  * @copyright Under the terms of the GNU General Public License v3
  * @version $Id: 02_EXE.php 313 2009-10-09 13:27:52Z catalin.zamfir $
  * @since Version 3.0
  * @access public
  * @static
  * @final
  */
 public static final function getUniqueHash(S $objHashAlgo, S $objStringData)
 {
     // Check to see if it's available ...
     if (_A(hash_algos())->inArray($objHashAlgo)) {
         // Do return ...
         return new S(hash($objHashAlgo, $objStringData));
     } else {
         // Error!
         self::renderScreenOfDeath(new S(__CLASS__), new S(FATAL_ERROR), new S(FATAL_ERROR_CHECK_LOG), new S(HASH_ALGORITHM_DOES_NOT_EXIST));
     }
 }
Exemple #9
0
<?php

_X('header-pre');
?>
<header>
	<?php 
_T('author-menu');
?>
	<h1 class="blogname"><?php 
echo _A('<a href="' . $content['blog']['href'] . '"><span id="e2-blog-title">' . $content['blog']['title'] . '</span></a>');
?>
<sup><a class="rss" href="<?php 
echo @$content['blog']['rss-href'];
?>
">абб</a></sup></h1>
	<div id="e2-blog-description" class="description">
		<?php 
echo $content['blog']['description'];
?>
	
	</div>
</header>
<?php 
_X('header-post');