本文整理汇总了PHP中regedit类的典型用法代码示例。如果您正苦于以下问题:PHP regedit类的具体用法?PHP regedit怎么用?PHP regedit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了regedit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerEvent
/**
* Зарегистрировать событие в истории событий
* @param string $eventTypeId идентификатор типа события
* @param array $params массив параметров события
* @param int $elementId id связанной страницы
* @param int $objectId id связанного объекта
*/
public function registerEvent($eventTypeId, $params = array(), $elementId = null, $objectId = null) {
$pool = ConnectionPool::getInstance();
$connection = $pool->getConnection();
umiEventFeed::setConnection($connection);
umiEventFeedType::setConnection($connection);
try {
$eventType = umiEventFeedType::get($eventTypeId);
} catch (Exception $e) {
$eventType = umiEventFeedType::create($eventTypeId);
}
$userId = permissionsCollection::getInstance()->getUserId();
$user = umiObjectsCollection::getInstance()->getObject($userId)->getName();
$module = cmsController::getInstance()->getModule('users');
$link = $module->getObjectEditLink($userId);
array_unshift($params, $user);
array_unshift($params, $link);
umiEventFeed::create($eventType, $params, $elementId, $objectId);
$maxDays = (int) regedit::getInstance()->getVal("//modules/events/max-days-storing-events");
if ($maxDays > 0) {
$lastDate = time() - ($maxDays * 24 * 60 * 60);
umiEventFeed::deleteList(array(), $lastDate);
}
}
示例2: config
public function config() {
$regedit = regedit::getInstance();
$params = Array(
"config" => Array(
"int:per_page" => NULL,
"boolean:confirm_user_answer" => NULL
)
);
$mode = getRequest("param0");
if($mode == "do") {
$params = $this->expectParams($params);
$regedit->setVar("//modules/faq/per_page", $params['config']['int:per_page']);
$regedit->setVar("//modules/faq/confirm_user_answer", $params['config']['boolean:confirm_user_answer']);
$this->chooseRedirect();
}
$params['config']['int:per_page'] = (int) $regedit->getVal("//modules/faq/per_page");
$params['config']['boolean:confirm_user_answer'] = (int) $regedit->getVal("//modules/faq/confirm_user_answer");
$this->setDataType("settings");
$this->setActionType("modify");
$data = $this->prepareData($params, "settings");
$this->setData($data);
return $this->doData();
}
示例3: banners_list
public function banners_list()
{
//Deprecated method
$regedit = regedit::getInstance();
$regedit->setVar("//modules/banners/default_method_admin", "lists");
$this->redirect($this->pre_lang . "/admin/banners/lists/");
}
示例4: detectFilters
static function detectFilters(selector $v8be74552df93e31bbdd6b36ed74bdb6a)
{
if ($v8be74552df93e31bbdd6b36ed74bdb6a->mode == 'pages') {
$ve4e46deb7f9cc58c7abfb32e5570b6f3 = (array) getRequest('domain_id');
foreach ($ve4e46deb7f9cc58c7abfb32e5570b6f3 as $v72ee76c5c29383b7c9f9225c1fa4d10b) {
$v8be74552df93e31bbdd6b36ed74bdb6a->where('domain')->equals($v72ee76c5c29383b7c9f9225c1fa4d10b);
}
$v5a05866850c28651fe234659f6c92ada = (array) getRequest('lang_id');
foreach ($v5a05866850c28651fe234659f6c92ada as $vf585b7f018bb4ced15a03683a733e50b) {
$v8be74552df93e31bbdd6b36ed74bdb6a->where('lang')->equals($vf585b7f018bb4ced15a03683a733e50b);
}
}
if ($v8be74552df93e31bbdd6b36ed74bdb6a->mode == 'pages' && sizeof($v8be74552df93e31bbdd6b36ed74bdb6a->types) && is_array(getRequest('rel')) && regedit::getInstance()->getVal('//modules/comments')) {
$v8be74552df93e31bbdd6b36ed74bdb6a->types('hierarchy-type')->name('comments', 'comment');
}
if (isset($_REQUEST['hierarchy_types'])) {
$vc7fcb1af65c062d638abb298ceddb52b = (array) $_REQUEST['hierarchy_types'];
foreach ($vc7fcb1af65c062d638abb298ceddb52b as $v9e3669d19b675bd57058fd4664205d2a) {
$v9e3669d19b675bd57058fd4664205d2a = explode('-', $v9e3669d19b675bd57058fd4664205d2a);
if (sizeof($v9e3669d19b675bd57058fd4664205d2a) == 2) {
$v8be74552df93e31bbdd6b36ed74bdb6a->types('hierarchy-type')->name($v9e3669d19b675bd57058fd4664205d2a[0], $v9e3669d19b675bd57058fd4664205d2a[1]);
}
}
}
self::detectHierarchyFilters($v8be74552df93e31bbdd6b36ed74bdb6a);
self::detectWhereFilters($v8be74552df93e31bbdd6b36ed74bdb6a);
self::detectOrderFilters($v8be74552df93e31bbdd6b36ed74bdb6a);
self::checkSyncParams($v8be74552df93e31bbdd6b36ed74bdb6a);
}
示例5: paymentCheckStep
public function paymentCheckStep(order $order, $step)
{
if ($step == 'address' && !regedit::getInstance()->getVal('//modules/emarket/enable-delivery') || $step == 'bonus' && !customer::get()->bonus) {
return false;
}
return $step;
}
示例6: onAddTopicToDispatch
public function onAddTopicToDispatch(iUmiEventPoint $oEvent)
{
$iDispatchId = regedit::getInstance()->getVal("//modules/forum/dispatch_id");
if (!$iDispatchId) {
return false;
}
$dispatches_module = cmsController::getInstance()->getModule('dispatches');
if (!$dispatches_module) {
return false;
}
$iTopicId = (int) $oEvent->getParam('topic_id');
$oTopicElement = umiHierarchy::getInstance()->getElement($iTopicId);
if ($oTopicElement instanceof umiHierarchyElement) {
$sTitle = (string) getRequest('title');
$sMessage = (string) getRequest('body');
$iHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "message")->getId();
$iMsgTypeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iHierarchyTypeId);
$oMsgType = umiObjectTypesCollection::getInstance()->getType($iMsgTypeId);
$iMsgObjId = umiObjectsCollection::getInstance()->addObject($sTitle, $iMsgTypeId);
$oMsgObj = umiObjectsCollection::getInstance()->getObject($iMsgObjId);
if ($oMsgObj instanceof umiObject) {
$iReleaseId = $dispatches_module->getNewReleaseInstanceId($iDispatchId);
$oMsgObj->setValue('release_reference', $iReleaseId);
$oMsgObj->setValue('header', $sTitle);
$oMsgObj->setValue('body', $sMessage);
$oMsgObj->commit();
return true;
} else {
return false;
}
} else {
return false;
}
}
示例7: partialReindex
public function partialReindex() {
$this->setDataType("settings");
$this->setActionType("view");
$lastId = (int) getRequest("lastId");
$search = searchModel::getInstance();
$total = (int) $search->getAllIndexablePages();
$limit = regedit::getInstance()->getVal("//modules/search/one_iteration_index");
if ($limit==0) {
$limit = 5;
}
$result = $search->index_all($limit, $lastId);
$data = Array(
'index-status' => Array(
'attribute:current' => $result['current'],
'attribute:total' => $total,
'attribute:lastId' => $result['lastId']
)
);
$this->setData($data);
return $this->doData();
}
示例8: renderDeliveryAddressesList
public function renderDeliveryAddressesList(order $order, $template = 'default')
{
list($tpl_block, $tpl_item) = def_module::loadTemplates("emarket/delivery/{$template}", 'delivery_address_block', 'delivery_address_item');
$customer = customer::get();
$addresses = $customer->delivery_addresses;
$items_arr = array();
$currentDeliveryId = $order->getValue('delivery_address');
$collection = umiObjectsCollection::getInstance();
if (is_array($addresses)) {
foreach ($addresses as $address) {
$addressObject = $collection->getObject($address);
$item_arr = array('attribute:id' => $address, 'attribute:name' => $addressObject->name);
if ($address == $currentDeliveryId) {
$item_arr['attribute:active'] = 'active';
$item_arr['void:checked'] = 'checked="checked" ';
} else {
$item_arr['void:checked'] = '';
}
$items_arr[] = def_module::parseTemplate($tpl_item, $item_arr, false, $address);
}
}
$types = umiObjectTypesCollection::getInstance();
$typeId = $types->getBaseType("emarket", "delivery_address");
$block_arr = array('attribute:type-id' => $typeId, 'attribute:type_id' => $typeId, 'xlink:href' => 'udata://data/getCreateForm/' . $typeId, 'subnodes:items' => $items_arr);
$regedit = regedit::getInstance();
if ((bool) $regedit->getVal('//modules/emarket/delivery-with-address')) {
$block_arr['delivery'] = $this->renderDeliveryList($order, $template, true);
} else {
$block_arr['void:delivery'] = '';
}
return def_module::parseTemplate($tpl_block, $block_arr);
}
示例9: __construct
public function __construct() {
parent::__construct();
if(cmsController::getInstance()->getCurrentMode() == "admin") {
$configTabs = $this->getConfigTabs();
if ($configTabs) {
$configTabs->add("config");
$configTabs->add("rss_list");
$configTabs->add("subjects");
}
$this->__loadLib("__admin.php");
$this->__implement("__news");
$this->__loadLib("__subjects.php");
$this->__implement("__subjects_news");
$this->__loadLib("__custom_adm.php");
$this->__implement("__custom_adm_news");
} else {
$this->__loadLib("__custom.php");
$this->__implement("__custom_news");
$this->per_page = regedit::getInstance()->getVal("//modules/news/per_page");
}
$this->__loadLib("__rss_import.php");
$this->__implement("__rss_import_news");
}
示例10: loadEventListeners
protected function loadEventListeners()
{
$v6c63406410aa57b3c97b88d3feb09990 = regedit::getInstance()->getList("//modules");
foreach ($v6c63406410aa57b3c97b88d3feb09990 as $v47c80780ab608cc046f2a6e6f071feb6) {
$v22884db148f0ffb0d830ba431102b0b5 = $v47c80780ab608cc046f2a6e6f071feb6[0];
$this->loadModuleEventListeners($v22884db148f0ffb0d830ba431102b0b5);
}
}
示例11: ch_remove_illegal_module
function ch_remove_illegal_module($module_name)
{
if (!trim($module_name, " \r\n\t\\/")) {
return;
}
$regedit = regedit::getInstance();
$regedit->delVar("//modules/{$module_name}");
//ch_remove_dir("./classes/modules/{$module_name}/");
}
示例12: security
public function security()
{
$regedit = regedit::getInstance();
$params = array('test' => array());
$this->setDataType("settings");
$this->setActionType("modify");
$data = $this->prepareData($params, "settings");
$this->setData($data);
return $this->doData();
}
示例13: __construct
public function __construct()
{
parent::__construct();
if (cmsController::getInstance()->getCurrentMode() == "admin") {
$this->__loadLib("__admin.php");
$this->__implement("__search");
} else {
$this->__loadLib("__custom.php");
$this->__implement("__custom_search");
$this->per_page = regedit::getInstance()->getVal("//modules/search/per_page");
}
}
示例14: confirmUserAnswer
public function confirmUserAnswer($oElement)
{
$bConfirmUserAnswer = (bool) regedit::getInstance()->getVal("//modules/faq/confirm_user_answer");
if (!$bConfirmUserAnswer) {
return true;
}
if ($oElement instanceof umiHierarchyElement && $oElement->getIsActive()) {
$iAuthorId = $oElement->getValue("author_id");
$author_name = "";
$author_email = "";
$oAuthor = umiObjectsCollection::getInstance()->getObject($iAuthorId);
if ($oAuthor instanceof umiObject) {
$author_user = null;
if ($oAuthor->getValue("is_registrated")) {
$user_id = $oAuthor->getValue("user_id");
$author_user = umiObjectsCollection::getInstance()->getObject($user_id);
}
if ($author_user instanceof umiObject) {
// author user
$author_name = $author_user->getValue("lname") . " " . $author_user->getValue("fname");
$author_email = $author_user->getValue("e-mail");
} else {
// author guest
$author_name = $oAuthor->getValue("nickname");
$author_email = $oAuthor->getValue("email");
}
}
if (umiMail::checkEmail($author_email)) {
list($sMailSubject, $sMailBody) = def_module::loadTemplatesForMail("faq/default", "answer_mail_subj", "answer_mail");
$block_arr = array();
$block_arr['domain'] = $sDomain = $_SERVER['HTTP_HOST'];
$block_arr['element_id'] = $iElementId = $oElement->getId();
$block_arr['author_id'] = $oElement->getValue("author_id");
$bOldFHStatus = umiHierarchy::getInstance()->forceAbsolutePath(true);
$block_arr['question_link'] = umiHierarchy::getInstance()->getPathById($iElementId);
umiHierarchy::getInstance()->forceAbsolutePath($bOldFHStatus);
$block_arr['ticket'] = $iElementId;
$sSubject = def_module::parseTemplateForMail($sMailSubject, $block_arr, $iElementId);
$sBody = def_module::parseTemplateForMail($sMailBody, $block_arr, $iElementId);
$from = regedit::getInstance()->getVal("//settings/fio_from");
$from_email = regedit::getInstance()->getVal("//settings/email_from");
$oMail = new umiMail();
$oMail->addRecipient($author_email);
$oMail->setFrom($from_email, $from);
$oMail->setSubject($sSubject);
$oMail->setContent($sBody);
$oMail->commit();
}
}
return true;
}
示例15: backup_copies
/**
* TODO PHPDoc
* Enter description here ...
*/
public function backup_copies()
{
$regedit = regedit::getInstance();
$backupDir = str_replace(CURRENT_WORKING_DIR, '', SYS_MANIFEST_PATH) . 'backup/';
$params = array("snapshots" => array("status:backup-directory" => $backupDir));
$ent = getRequest('ent');
if (!$ent) {
$ent = time();
$this->redirect($this->pre_lang . '/admin/backup/backup_copies/?ent=' . $ent);
}
$this->setDataType("settings");
$this->setActionType("modify");
$data = $this->prepareData($params, "settings");
$this->setData($data);
return $this->doData();
}