예제 #1
0
파일: 404.php 프로젝트: r3c130n/scriptacid
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/kernel.php";
App::get()->makePage(function () {
    @define("ERROR_404", "Y");
    $_SERVER["REDIRECT_STATUS"] = 404;
    header("HTTP/1.0 404 Not Found");
    SetTitle("404 - HTTP not found");
    ShowError("Страница не найдена");
    ?>

<?php 
});
// end of makePage
예제 #2
0
<?php

namespace ScriptAcid;

if (!defined("KERNEL_INCLUDED") || KERNEL_INCLUDED !== true) {
    die;
}
global $USER;
if ($arParams["SET_TITLE"]) {
    SetTitle($arParams["TITLE_TEXT"]);
}
$arResult["USER"] = $USER->GetByID(intVal($arParams["USER_ID"]));
if (!($arResult["GROUPS"] = UserGroups::GetGroupList())) {
    $arResult["GROUPS"] = array();
}
$this->connectComponentTemplate();
예제 #3
0
<?php

namespace ScriptAcid;

if (!defined("KERNEL_INCLUDED") || KERNEL_INCLUDED !== true) {
    die;
}
if (!Modules::includeModule('catalog')) {
    ShowError("Модуль каталогов не установлен.");
    return;
}
$arParams["CATALOG_ID"] = intVal($arParams["CATALOG_ID"]);
$arFilter = array();
if (array_key_exists("=SECTION_ID", $arParams)) {
    $arFilter['=CATALOG_SECTION_ID'] = empty($arParams["=SECTION_ID"]) ? 'NULL' : $arParams["=SECTION_ID"];
} else {
    $arFilter['CATALOG_SECTION_ID'] = !empty($arParams["SECTION_ID"]) ? intVal($arParams["SECTION_ID"]) : '';
}
$arFilter["ID"] = intVal($arParams["ELEMENT_ID"]);
$arFilter["CATALOG_ID"] = $arParams["CATALOG_ID"];
$rs = CatalogElement::GetList(array(), $arFilter);
if ($ob = $rs->GetNextElement()) {
    $arElement = $ob->GetFields();
    $arElement['PROPERTIES'] = $ob->GetProperties();
    $arElement["DETAIL_PAGE_URL"] = str_replace(array("#SECTION_ID#", "#ID#"), array($arElement['CATALOG_SECTION_ID'], $arElement['ID']), $arElement["DETAIL_PAGE_URL"]);
    $arElement["SECTION_PAGE_URL"] = str_replace("#SECTION_ID#", $arElement['CATALOG_SECTION_ID'], $arElement["SECTION_PAGE_URL"]);
    $arResult = $arElement;
    SetTitle($arElement["NAME"]);
}
$this->connectComponentTemplate();
예제 #4
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle("Панель управления :: Типы каталогов");
App::get()->makePage(function (&$arPageParams) {
    ?>


<?php 
    if (!Modules::includeModule('catalog')) {
        ShowError("Модуль каталогов не утановен.");
    } else {
        ?>


	<?php 
        switch ($_GET["ACTION"]) {
            case 'ADD':
                ?>
			<h3><?php 
                echo LANG("MODULE_CATALOG_TYPES_ADD_TITLE");
                ?>
</h3>
			<?php 
                ShowMsg();
                ?>
			<?php 
                App::callComponent(":catalog.type.add", "_admin", array("FIELDS" => array("ID", "NAME", "SORT", "SID", "SECTION_NAME", "ELEMENT_NAME")));
                ?>
예제 #5
0
파일: user.php 프로젝트: r3c130n/scriptacid
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle("Панель управления :: Пользователи");
App::get()->makePage(function (&$arPageParams) {
    ?>

<?php 
    if (intVal($_GET["ID"]) > 0) {
        Component::callComponent("system.user.detail", "", array("SET_TITLE" => "Y", "TITLE_TEXT" => "Панель управления :: Профиль пользователя", "USER_ID" => intVal($_GET["ID"])));
    }
    ?>

<?php 
});
// end of makePage
예제 #6
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle("Панель управления :: Каталоги");
App::get()->makePage(function (&$arPageParams) {
    ?>


<?php 
    if (!Modules::includeModule('catalog')) {
        ShowError("Модуль каталогов не утановен.");
    } else {
        switch ($_GET["ACTION"]) {
            case 'ADD':
                ?>
		<h3><?php 
                echo LANG("MODULE_CATALOG_ADD_TITLE");
                ?>
</h3>
		<?php 
                ShowMsg();
                ?>
		<?php 
                Component::callComponent(":catalog.add", "_admin", array("FIELDS" => array("ID", "ACTIVE", "NAME", "CATALOG_TYPE_ID", "SORT", "SID", "CODE", "LIST_PAGE_URL", "DETAIL_PAGE_URL", "SECTION_PAGE_URL", "PICTURE", "DESCRIPTION", "DESCRIPTION_TYPE", "SECTIONS_NAME", "ELEMENTS_NAME", "SECTION_NAME", "ELEMENT_NAME", "SEO_DESCRIPTION", "SEO_KEYWORDS"), "TYPE" => $_GET["TYPE"]));
                ?>
	<?php 
                break;
                ?>
	<?php 
예제 #7
0
<?php

namespace ScriptAcid;

if (!defined("KERNEL_INCLUDED") || KERNEL_INCLUDED !== true) {
    die;
}
?>
<div class="post no-bg">
<?php 
if (!empty($arResult)) {
    $title = $arResult["PROPERTIES"]["GROUP"]["VALUE"] . ' - (' . $arResult["PROPERTIES"]["YEAR"]["VALUE"] . ') ' . $arResult["PROPERTIES"]["ALBUM"]["VALUE"];
    SetTitle($title);
    ?>
	<table width="100%">
		<tr>
			<td width="20%">
				<img src="<?php 
    echo File::GetPath($arResult['DETAIL_PICTURE']);
    ?>
" title="<?php 
    echo $title;
    ?>
" alt="<?php 
    echo $title;
    ?>
"/>
			</td>
			<td style="vertical-align: top">
				<b>Автор: </b> <?php 
    echo $arResult["PROPERTIES"]["GROUP"]["VALUE"];
예제 #8
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle('Проект "ScriptACID CMF": Squery class test.');
App::get()->makePage(function (&$arPageParams) {
    ?>

<?php 
    echo "DATABASE TYPE: " . SQuery::DB_TYPE . endl;
    function ___testSQueryClass()
    {
        $start = microtime(true);
        //*/
        $start = microtime(true);
        $squery = new SQuery();
        $startSetTpl = microtime(true);
        $addedNewType = $squery->setType("sometype", function (&$arPLACEHOLDER, &$value) {
            d($arPLACEHOLDER);
            d($value);
            exit;
        });
        echo ($addedNewType ? "Новый тип добавлен" : "Новый тип не добавлен") . endl;
        $squery->template = '
			SELECT * FROM table
			WHERE
				id = ?int
				AND
				bvar = ?boolean
				AND
예제 #9
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle("Панель управления - Настройки сайта");
App::get()->makePage(function (&$arPageParams) {
    ?>


<p>
Здесь скоро будет страница настроек системы
</p>
<p>Будет возможность менять следующие параметры системы:</p>
<ul>
	<li>Заголовок сайта</li>
	<li>Описание сайта</li>
	<li>Название сайта</li>
	<li>Логотип сайта</li>
</ul>

<?php 
});
// end of makePage
예제 #10
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle('Новости');
App::get()->makePage(function (&$arPageParams) {
    ?>

	<p>Новостей нет. Здесь закомментирован код вызова компонент (как пример)</p>
	<?php 
    if (intVal($_GET["ELEMENT_ID"])) {
        ?>
	<?php 
        App::callComponent("system:catalog.element", "", array("CATALOG_TYPE" => "news", "CATALOG_ID" => 1, "SECTION_CODE" => $_GET["SECTION_CODE"], "ELEMENT_ID" => $_GET["ELEMENT_ID"]));
        ?>
	<?php 
    } else {
        ?>
	<?php 
        App::callComponent("system:catalog.section", "news", array("CATALOG_TYPE" => "news", "CATALOG_ID" => 1, "SORT_ORDER" => 'DESC', "SORT_FIELD" => 'ID', "SECTION_CODE" => $_GET["SECTION_CODE"], "CURRENT_PAGE" => $_GET['PAGE'], "PAGE_COUNT" => 5));
        ?>
	<?php 
    }
    ?>

<?php 
});
// end of makePage
예제 #11
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/kernel.php";
SetTitle("Завершение сеанса пользователя");
//App::get()->makePage(function(&$arPageParams) {
?>

<?php 
if (App::USER()->IsAuthorized() and $_GET['logout'] == 'Y') {
    App::USER()->UnAuthorize();
    ShowMsg('Заходите к нам еще!');
    RedirectTo('/', 3000);
} else {
    ShowError('Вы не вошли');
}
?>

<?php 
// }); // end of makePage
예제 #12
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle("Админка::Элементы каталога");
Modules::includeModule("catalog");
App::get()->makePage(function (&$arPageParams) {
    ?>


<?php 
    switch ($_GET["ACTION"]) {
        case 'ADD_SECTION':
            ?>
		<h3><?php 
            echo LANG("MODULE_CATALOG_SECTION_ADD_TITLE");
            ?>
</h3>
		<?php 
            ShowMsg();
            ?>
		<?php 
            App::callComponent(":catalog.section.add", "_admin", array("FIELDS" => array("ID", "ACTIVE", "NAME", "CATALOG_SECTION_ID", "CATALOG_ID", "SORT", "CODE", "PREVIEW_PICTURE", "PREVIEW_TEXT", "PREVIEW_TEXT_TYPE", "DETAIL_PICTURE", "DETAIL_TEXT", "DETAIL_TEXT_TYPE"), "TYPE" => $_GET["TYPE"], "CATALOG_ID" => $_GET['CATALOG_ID']));
            ?>
		<?php 
            break;
        case 'ADD':
            ?>
		<h3><?php 
            echo LANG("MODULE_CATALOG_ELEMENTS_ADD_TITLE");
예제 #13
0
<?php

namespace ScriptAcid;

define("DIRECT_LOAD_CLASSES", true);
$startSysinit = microtime(true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle('Проект "ScriptACID CMF": DIRECT_LOAD_CLASSES test.');
App::get()->arPageParams = array("startSysinit" => $startSysinit);
App::get()->makePage(function (&$arPageParams) {
    ?>

	<?php 
    $stopSysinit = microtime(true);
    echo $deltaSysinit = $stopSysinit - $arPageParams["startSysinit"];
    ?>
	
	<p class="some-class">Тестовая версия ScriptACID CMF: DIRECT_LOAD_CLASSES test.</p>
	DIRECT_LOAD_CLASSES == <?php 
    echo DIRECT_LOAD_CLASSES ? "true" : "false";
    ?>
	<br />
<?php 
});
// end of makePage
예제 #14
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
App::get()->makePage(function (&$arPageParams) {
    ?>

<?php 
    SetTitle("Панель управления");
    ?>
<p style="width:100%"><img src="/scriptacid/admin/images/r3c130n.jpg" width="120" height="120" alt="" class="float-left border" />
Вы находитесь в <b>Панели управления</b> сайтом. Здесь Вы можете менять настройки сайта, производить свои хитрые манипуляции 
с элементами сайта и многое другое..
</p>

<?php 
});
// end of makePage
예제 #15
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
App::page(function (&$arPageParams) {
    ?>

<?php 
    App::USER()->Authorize('1');
    SetTitle('Проект "ScriptACID CMF"');
    ?>

<?php 
    App::callComponent('system:catalog.section', '_default:default', array('TYPE' => 'orion_locations', 'CATALOG_ID' => '3', 'CACHE_TIME' => '3600', 'COMPONENT_AJAX_MODE' => 'OFF', 'LIST_URL' => '', 'ELEMENT_URL' => '', 'COMPONENT_AJAX_SEND_PAGE_POST' => 'N'));
    ?>


<?php 
    App::callComponent('system:catalog.element.add', '_default:default', array('TYPE' => 'orion_locations', 'FIELDS' => array('1' => 'ID', '2' => 'NAME', '3' => 'CATALOG_SECTION_ID', '4' => 'CODE', '5' => 'PREVIEW_PICTURE', '6' => 'PREVIEW_TEXT', '7' => 'PREVIEW_TEXT_TYPE', '8' => 'DETAIL_PICTURE', '9' => 'DETAIL_TEXT'), 'CATALOG_ID' => '3', 'ID' => '{%_GET[ID]}', 'ACTION_PARAMETER' => '{%_GET[ACTION]}', 'COMPONENT_AJAX_MODE' => 'OFF', 'CACHE_TIME' => '3600', 'LIST_URL' => '/test/test_edit_component_call.php', 'ELEMENT_URL' => '/test/test_edit_component_call.php?ID=#ID#', 'COMPONENT_AJAX_SEND_PAGE_POST' => 'N'));
    ?>

<?php 
    App::callComponent('test:empty', '_default:default', array('CACHE_TIME' => '36001', 'COMPONENT_AJAX_MODE' => 'OFF', 'COMPONENT_AJAX_SEND_PAGE_POST' => 'N'));
    App::callComponent('test:empty', '_default:default', array('CACHE_TIME' => '36002', 'COMPONENT_AJAX_MODE' => 'OFF', 'COMPONENT_AJAX_SEND_PAGE_POST' => 'N'));
    ?>

<?php 
    // d(ComponentTools::getComponentListInFile('public_page'))
    ?>
예제 #16
0
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle('О нас');
App::get()->makePage(function (&$arPageParams) {
    ?>


<p>Авторы проекта <b>"ScriptACID CMF"</b>:
    <br />r3c130n
    <br />pr0n1x
</p>

<?php 
});
// end of makePage
<?php

namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php";
SetTitle('Проект "ScriptACID CMF". Тест получения параметров компонента');
App::page(function (&$arPageParams) {
    ?>


<?php 
    echo "<b>:catalog.element.add@_default</b>" . endl;
    $arCatalogElementAddComponentSettings = ComponentTools::getSettingsByName(':catalog.element.add');
    d($arCatalogElementAddComponentSettings, ':catalog.element.add');
    $arTplList = ComponentTools::getTemplatesList(':catalog.element.add');
    d($arTplList, ':catalog.element.add - templates list');
    echo "<b>:menu@top</b>" . endl;
    $arMenuTopComponentSettings = ComponentTools::getSettingsByName(":menu", 'top');
    d($arMenuTopComponentSettings, ':menu@top');
    echo "<b>:menu@left</b>" . endl;
    $arMenuLeftComponentSettings = ComponentTools::getSettingsByName(':menu', 'left');
    d($arMenuLeftComponentSettings, ':menu@left');
    $arTplList = ComponentTools::getTemplatesList(':menu');
    d($arTplList, ':menu - templates list');
    ?>


<?php 
});
// end of makePage