Exemplo n.º 1
0
 /**
  *
  * Kilka dodatkowych statycznych inicjaliacji
  *
  */
 public function _initStatics()
 {
     $config = $this->getApplication()->getOptions();
     /**
      * Ustawienie konfigu na rejestrze dla kompatybilnosci z poprzednmi rozwiazaniami (resouce plugin dla ACL)
      */
     Zend_Registry::set('config', $config);
     if (isset($config['general']['pluginloader']) and $config['general']['pluginloader']) {
         $classFileIncCache = APPLICATION_PATH . '/../tmp/pluginLoaderCache.php';
         if (file_exists($classFileIncCache)) {
             include_once $classFileIncCache;
         }
         Zend_Loader_PluginLoader::setIncludeFileCache($classFileIncCache);
     }
     /**
      * Ustawienie fallback tak by klasy bez namespacu tez dzialaly
      */
     Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true)->pushAutoloader(NULL, 'Smarty_');
     /**
      * Domyslny rozmiar strony paginatora
      */
     Zend_Paginator::setDefaultItemCountPerPage($config['paginator']['DefaultItemCountPerPage']);
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('/common/paginator_footer.phtml');
     Zend_Controller_Action_HelperBroker::addPrefix('Base_Controller_Action_Helper');
     Zend_Markup::addRendererPath('Logic', 'Logic/');
     Base_Logic_Abstract::setUsePreexecuteHooks($config['general']['usepreexecutehooks']);
 }
Exemplo n.º 2
0
 /**
  * Get the renderer loader
  *
  * @return Zend_Loader_PluginLoader
  */
 public static function getRendererLoader()
 {
     if (!self::$_rendererLoader instanceof Zend_Loader_PluginLoader) {
         self::$_rendererLoader = new Zend_Loader_PluginLoader(array('Zend_Markup_Renderer' => 'Zend/Markup/Renderer/'));
     }
     return self::$_rendererLoader;
 }
Exemplo n.º 3
0
 protected static function _getInstance($renderer = 'Html', array $options = array())
 {
     $BBCode = Zend_Markup::factory('Bbcode', $renderer, $options);
     $BBCode->removeMarkup('quote');
     $BBCode->addMarkup('quote', Zend_Markup_Renderer_RendererAbstract::TYPE_CALLBACK, array('callback' => new Zwe_Markup_Renderer_Html_Quote(), 'group' => 'block'));
     return $BBCode;
 }
 public function testBbcodeParser()
 {
     $parser = Zend_Markup::factory('bbcode')->getParser();
     $value = '[b][s][i]foobar[/i][/s][/b]';
     $output = '';
     $tree = $parser->parse($value);
     // iterate trough the tree and check if we can generate the original value
     $iterator = new RecursiveIteratorIterator($tree, RecursiveIteratorIterator::SELF_FIRST);
     foreach ($iterator as $token) {
         $output .= $token->getTag();
         if ($token->getStopper() != '') {
             $token->addChild(new Zend_Markup_Token($token->getStopper(), Zend_Markup_Token::TYPE_NONE, '', array(), $token));
         }
     }
     $this->assertEquals($value, $output);
 }
Exemplo n.º 5
0
 /**
  * Sets up the fixture
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     $this->_markup = Zend_Markup::factory('bbcode', 'html');
 }
Exemplo n.º 6
0
 public function testFactory()
 {
     Zend_Markup::addParserPath('Zend_Markup_Test_Parser', 'Zend/Markup/Test/Parser');
     Zend_Markup::addRendererPath('Zend_Markup_Test_Renderer', 'Zend/Markup/Test/Renderer');
     Zend_Markup::factory('MockParser', 'MockRenderer');
 }
Exemplo n.º 7
0
 /**
  * Get Summary
  *
  * @param boolean $asHtml
  * @return string
  */
 public function getSummary($asHtml = false)
 {
     if (!$asHtml) {
         return $this->_summary;
     }
     if (0 == strlen($this->_summary)) {
         return '';
     }
     $textile = Zend_Markup::factory('Textile');
     return $textile->render($this->_summary);
 }
Exemplo n.º 8
0
/*
  Copyright (C) <2011>  Vasyl Martyniuk <*****@*****.**>
 This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.
 This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once '../../../../wp-admin/admin.php';
require_once 'Zend/Markup.php';
require_once 'bbcodes.php';
wp_enqueue_style('aam-treeview', WPACCESS_CSS_URL . 'treeview/jquery.treeview.css');
wp_enqueue_style('aam-reference', WPACCESS_CSS_URL . 'reference.css');
wp_enqueue_script('jquery-treeview', WPACCESS_JS_URL . 'treeview/jquery.treeview.js', array('jquery'));
wp_enqueue_script('jquery-treeedit', WPACCESS_JS_URL . 'treeview/jquery.treeview.edit.js');
wp_enqueue_script('admin-reference', WPACCESS_JS_URL . 'admin-reference.js');
iframe_header('ConfigPress Reference');
$template = mvb_Model_Template::readTemplate(WPACCESS_TEMPLATE_DIR . 'reference.html');
mvb_Model_Label::initConfigPressGuideLabels();
$bbcode = Zend_Markup::factory('Bbcode');
foreach ($bbcode_list as $code => $config) {
    $bbcode->addMarkup($code, Zend_Markup_Renderer_RendererAbstract::TYPE_REPLACE, $config);
}
$template = mvb_Model_Label::clearLabels($template, $bbcode);
echo mvb_Model_Template::clearTemplate($template);
iframe_footer();
Exemplo n.º 9
0
/**
 * parse textile
 */
function textile($text)
{
    require_once 'Zend/Markup.php';
    // Creates instance of Zend_Markup_Renderer_Html,
    // with Zend_Markup_Parser_BbCode as its parser
    $textilecode = Zend_Markup::factory('Textile');
    return $textilecode->render($text);
}