EOF;
$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the - option to remove one javascript previously added');
$handler->setConfiguration(array('all' => array('stylesheets' => array('foo', 'bar', '-*', 'baz'))));
$content = <<<EOF
  \$response->addStylesheet('baz', '', array ());

EOF;
$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the -* option to remove all stylesheets previously added');
$handler->setConfiguration(array('all' => array('javascripts' => array('foo', 'bar', '-*', 'baz'))));
$content = <<<EOF
  \$response->addJavascript('baz', '', array ());

EOF;
$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the -* option to remove all javascripts previously added');
$handler->setConfiguration(array('all' => array('stylesheets' => array('-*', 'foobar')), 'default' => array('stylesheets' => array('default_foo', 'default_bar'))));
$content = <<<EOF
  \$response->addStylesheet('foobar', '', array ());

EOF;
$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the -* option to remove all assets previously added');
$handler->setConfiguration(array('myView' => array('stylesheets' => array('foobar', '-*', 'bar'), 'javascripts' => array('foobar', '-*', 'bar')), 'all' => array('stylesheets' => array('all_foo', 'all_foofoo', 'all_barbar'), 'javascripts' => array('all_foo', 'all_foofoo', 'all_barbar')), 'default' => array('stylesheets' => array('default_foo', 'default_foofoo', 'default_barbar'), 'javascripts' => array('default_foo', 'default_foofoo', 'default_barbar'))));
$content = <<<EOF
  \$response->addStylesheet('bar', '', array ());
  \$response->addJavascript('bar', '', array ());

EOF;
$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the -* option to remove all assets previously added');
function fix_content($content)
{
    return str_replace(array("\r\n", "\n", "\r"), "\n", $content);
}
Example #2
0
 function get_html($id = null)
 {
     $row['html'] = '';
     if (!empty($id)) {
         $row = $this->db->fetch_array($this->db->query("SELECT html FROM " . TABLE_SITEMENU . " WHERE id='" . $id . "'"));
     }
     return fix_content($row['html']);
 }
Example #3
0
$form_data = array('fio' => array('Представьтесь', 'text', 1), 'tel' => array('Ваш телефон', 'phone', 1), 'email' => array('Электронная почта', 'email', 1), array('Сообщение', 'textarea', 0));
$form = '';
/* вставка формы обратной связи */
if (!empty($sets['allow_feedback']) && !isset($_POST['order_call_form'])) {
    $form = Site_Sitemenu::gI()->add_feedback($ebox['id_feedback'], $ebox['email'], $form_data);
}
if (empty($content['path']) || $content['path'] == '') {
    $site->_404();
}
if (!empty($content['html'])) {
    $content['html'] = fix_content($content['html']);
}
l('index');
$content['html'] = $content['html'] . $form;
if (is_ajax() && empty($_POST)) {
    $content['html'] = (class_exists('Ishop') && $sets['mod_spec'] && $_SERVER['REQUEST_URI'] == '/' ? Ishop::gI()->filteredProducts('spec', $sets['count_spec']) : '') . fix_content($content['html']);
    $content['url'] = SITE_URL . substr($_SERVER['REQUEST_URI'], 1);
    echo json_encode($content);
    exit;
}
/* подключение файла с версткой */
$ind_file = TEMP_FOLDER . 'html/i.php';
if (file_exists($ind_file)) {
    require TEMP_FOLDER . 'config.php';
    include $ind_file;
    //$c = ob_get_contents();
    //ob_end_clean();
    //echo str_replace("\n", "", str_replace("\r", "", str_replace("\t", "", $c)));
} else {
    header('HTTP/1.1 503 Service temporary down');
    die("Отсутствует файл " . $ind_file . "");
Example #4
0
 function get()
 {
     $content = array();
     $_GET['type'] = empty($_GET['type']) ? 'm' : $_GET['type'];
     $type_name = 'modules/ishop/' . $_GET['type'] . '.php';
     if (file_exists($type_name)) {
         require $type_name;
     }
     if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
         /*require INC_DIR."Array2XML.php";
         
         			header('Content-type: application/xml');
         			$xml = Array2XML::createXML('content', $content);
         			echo trim($xml->saveXML());
         			exit;*/
         $content['html'] = fix_content($content['html']);
         $content['url'] = SITE_URL . substr($_SERVER['REQUEST_URI'], 1);
         echo json_encode($content);
         exit;
     }
     return $content;
 }