public function renderUsersView() { $userModel = $this->container->get('UserModel'); htmlHeader('users'); require VIEW_DIR . '/menu.php'; require VIEW_DIR . '/users.php'; htmlFooter(); }
function dienice($message = null) { if ($message == null || $message == '') { $message = 'unknown error in version-check'; } $err = ' <div class="ErrorContainer"> <div class="ErrorTitle">Error</div> <div class="Error">' . $message . '</div> </div> '; $err = $err . htmlFooter(); die($err); }
/** * prepares variables to use in moduleHandler * @param string $module name of module * @param string $act name of action * @param int $mid * @param int $document_srl * @param int $module_srl * @return void **/ function ModuleHandler($module = '', $act = '', $mid = '', $document_srl = '', $module_srl = '') { // If XE has not installed yet, set module as install if (!Context::isInstalled()) { $this->module = 'install'; $this->act = Context::get('act'); return; } // Set variables from request arguments $this->module = $module ? $module : Context::get('module'); $this->act = $act ? $act : Context::get('act'); $this->mid = $mid ? $mid : Context::get('mid'); $this->document_srl = $document_srl ? (int) $document_srl : (int) Context::get('document_srl'); $this->module_srl = $module_srl ? (int) $module_srl : (int) Context::get('module_srl'); $this->entry = Context::convertEncodingStr(Context::get('entry')); // Validate variables to prevent XSS $isInvalid = null; if ($this->module && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->module)) { $isInvalid = true; } if ($this->mid && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->mid)) { $isInvalid = true; } if ($this->act && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->act)) { $isInvalid = true; } if ($isInvalid) { htmlHeader(); echo Context::getLang("msg_invalid_request"); htmlFooter(); Context::close(); exit; } if (isset($this->act) && substr($this->act, 0, 4) == 'disp') { if (Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && $_SERVER['HTTPS'] != 'on') { header('location:https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); return; } } // execute addon (before module initialization) $called_position = 'before_module_init'; $oAddonController =& getController('addon'); $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? 'mobile' : 'pc'); @(include $addon_file); }
/** * Trackbacks sent * @return object */ function procTrackbackSend() { // Yeokingeul to post numbers and shipping addresses Wanted $document_srl = Context::get('target_srl'); $trackback_url = Context::get('trackback_url'); $charset = Context::get('charset'); if (!$document_srl || !$trackback_url || !$charset) { return new Object(-1, 'msg_invalid_request'); } // Login Information Wanted $logged_info = Context::get('logged_info'); if (!$logged_info->member_srl) { return new Object(-1, 'msg_not_permitted'); } // Posts of the information obtained permission to come and check whether $oDocumentModel =& getModel('document'); $oDocument = $oDocumentModel->getDocument($document_srl); if (!$oDocument->isExists() || !$oDocument->getSummary()) { return new Object(-1, 'msg_invalid_request'); } if ($oDocument->getMemberSrl() != $logged_info->member_srl) { return new Object(-1, 'msg_not_permitted'); } // Specify the title of the module, the current article $oModuleModel =& getModel('module'); $module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')); Context::setBrowserTitle($module_info->browser_title); // Shipping yeokingeul $output = $this->sendTrackback($oDocument, $trackback_url, $charset); if ($output->toBool() && !in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { global $lang; htmlHeader(); alertScript($lang->success_registed); reload(true); closePopupScript(); htmlFooter(); Context::close(); exit; } return $output; }
function shareHtml($htmlUrl) { $serverPath = $_SERVER['DOCUMENT_ROOT'] . "/web_test/image_test/upload_html/"; // echo 'path: '.$serverPath.$htmlUrl; if (!file_exists($serverPath . $htmlUrl)) { // file check echo 'file not found'; exit; } htmlHeader(); $toDeleteString = ":8080"; $toReplaceString = ""; $myfile = fopen($serverPath . $htmlUrl, "r") or die("Unable to open file!"); // Output one line until end-of-file while (!feof($myfile)) { // echo str_replace($toDeleteString, $toReplaceString, fgets($myfile)) . "<br>"; echo fgets($myfile) . "<br>"; } fclose($myfile); htmlFooter(); }
/** * Single Sign On (SSO) * * @return bool True : Module handling is necessary in the control path of current request , False : Otherwise */ public function checkSSO() { // pass if it's not GET request or XE is not yet installed if ($this->db_info->use_sso != 'Y' || isCrawler()) { return TRUE; } $checkActList = array('rss' => 1, 'atom' => 1); if (self::getRequestMethod() != 'GET' || !self::isInstalled() || isset($checkActList[self::get('act')])) { return TRUE; } // pass if default URL is not set $default_url = trim($this->db_info->default_url); if (!$default_url) { return TRUE; } if (substr_compare($default_url, '/', -1) !== 0) { $default_url .= '/'; } // Get current site information (only the base URL, not the full URL) $current_site = self::getRequestUri(); // Step 1: if the current site is not the default site, send SSO validation request to the default site if ($default_url !== $current_site && !self::get('SSOID') && $_COOKIE['sso'] !== md5($current_site)) { // Set sso cookie to prevent multiple simultaneous SSO validation requests setcookie('sso', md5($current_site), 0, '/'); // Redirect to the default site $redirect_url = sprintf('%s?return_url=%s', $default_url, urlencode(base64_encode($current_site))); header('Location:' . $redirect_url); return FALSE; } // Step 2: receive and process SSO validation request at the default site if ($default_url === $current_site && self::get('return_url')) { // Get the URL of the origin site $url = base64_decode(self::get('return_url')); $url_info = parse_url($url); // Check that the origin site is a valid site in this XE installation (to prevent open redirect vuln) if (!getModel('module')->getSiteInfoByDomain(rtrim($url, '/'))->site_srl) { htmlHeader(); echo self::getLang("msg_invalid_request"); htmlFooter(); return FALSE; } // Redirect back to the origin site $url_info['query'] .= ($url_info['query'] ? '&' : '') . 'SSOID=' . session_id(); $redirect_url = sprintf('%s://%s%s%s%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':' . $url_info['port'] : '', $url_info['path'], $url_info['query'] ? '?' . $url_info['query'] : ''); header('Location:' . $redirect_url); return FALSE; } // Step 3: back at the origin site, set session ID to be the same as the default site if ($default_url !== $current_site && self::get('SSOID')) { // Check that the session ID was given by the default site (to prevent session fixation CSRF) if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $default_url) !== 0) { htmlHeader(); echo self::getLang("msg_invalid_request"); htmlFooter(); return FALSE; } // Set session ID setcookie(session_name(), self::get('SSOID')); // Finally, redirect to the originally requested URL $url_info = parse_url(self::getRequestUrl()); $url_info['query'] = preg_replace('/(^|\\b)SSOID=([^&?]+)/', '', $url_info['query']); $redirect_url = sprintf('%s://%s%s%s%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':' . $url_info['port'] : '', $url_info['path'], $url_info['query'] ? '?' . $url_info['query'] : ''); header('Location:' . $redirect_url); return FALSE; } // If none of the conditions above apply, proceed normally return TRUE; }
/** * Update a group of selected memebrs * @return void|Object (void : success, Object : fail) */ function procMemberAdminUpdateMembersGroup() { $member_srl = Context::get('member_srl'); if (!$member_srl) { return new Object(-1, 'msg_invalid_request'); } $member_srls = explode(',', $member_srl); $group_srl = Context::get('group_srls'); if (!is_array($group_srl)) { $group_srls = explode('|@|', $group_srl); } else { $group_srls = $group_srl; } $oDB =& DB::getInstance(); $oDB->begin(); // Delete a group of selected members $args = new stdClass(); $args->member_srl = $member_srl; $output = executeQuery('member.deleteMembersGroup', $args); if (!$output->toBool()) { $oDB->rollback(); return $output; } // Add to a selected group $group_count = count($group_srls); $member_count = count($member_srls); for ($j = 0; $j < $group_count; $j++) { $group_srl = (int) trim($group_srls[$j]); if (!$group_srl) { continue; } for ($i = 0; $i < $member_count; $i++) { $member_srl = (int) trim($member_srls[$i]); if (!$member_srl) { continue; } $args = new stdClass(); $args->member_srl = $member_srl; $args->group_srl = $group_srl; $output = executeQuery('member.addMemberToGroup', $args); if (!$output->toBool()) { $oDB->rollback(); return $output; } } } $oDB->commit(); $this->_deleteMemberGroupCache(); $this->setMessage('success_updated'); if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { global $lang; htmlHeader(); alertScript($lang->success_updated); reload(true); closePopupScript(); htmlFooter(); Context::close(); exit; } }
$msgs = ''; } /** * Close the Qdig gallery table. */ if (empty($imgs) && !empty($subdirs)) { $tag = '</td>'; } else { $tag = ''; } echo <<<EOT {$tag}</tr>{$msgs}</table> <!-- End Qdig Image Gallery v{$qdig_version} --> EOT; // For injecting some output after the gallery if (isset($post_gallery)) { echo $post_gallery; } /** * Echo an HTML Footer if the script is running stand-alone. */ echo htmlFooter($header); // Leave the working dir and error reporting the way we found them. if (isset($orig_wd)) { chdir($orig_wd); } error_reporting($orig_err_rep_level); /* vim: set noexpandtab tabstop=4 shiftwidth=4: */
/** * layout copy * @return void */ function procLayoutAdminCopyLayout() { $sourceArgs = Context::getRequestVars(); if ($sourceArgs->layout == 'faceoff') { return $this->stop('not supported'); } if (!$sourceArgs->layout_srl) { return $this->stop('msg_empty_origin_layout'); } $oLayoutModel = getModel('layout'); $layout = $oLayoutModel->getLayout($sourceArgs->layout_srl); if (!$sourceArgs->title) { $sourceArgs->title = array($layout->title . '_' . $this->_makeRandomMid()); } if (!is_array($sourceArgs->title) || count($sourceArgs->title) == 0) { return $this->stop('msg_empty_target_layout'); } $output = $oLayoutModel->getLayoutRawData($sourceArgs->layout_srl, array('extra_vars')); $args = new stdClass(); $args->extra_vars = $output->extra_vars; $extra_vars = unserialize($args->extra_vars); if ($layout->extra_var_count) { $reg = "/^.\\/files\\/attach\\/images\\/([0-9]+)\\/(.*)/"; if ($extra_vars) { foreach ($extra_vars as $key => $val) { if ($layout->extra_var->{$key}->type == 'image') { if (!preg_match($reg, $val, $matches)) { continue; } $image_list[$key]->filename = $matches[2]; $image_list[$key]->old_file = $val; } } } } $oModuleController = getController('module'); $layout_config = new stdClass(); $layout_config->header_script = $extra_vars->header_script; // Get information to create a layout $args->site_srl = (int) $layout->site_srl; $args->layout = $layout->layout; $args->layout_type = $layout->layout_type; if (!$args->layout_type) { $args->layout_type = "P"; } $oDB =& DB::getInstance(); $oDB->begin(); if (is_array($sourceArgs->title)) { foreach ($sourceArgs->title as $key => $value) { if (!trim($value)) { continue; } $args->layout_srl = getNextSequence(); $args->title = $value; if (is_array($image_list)) { foreach ($image_list as $key => $val) { $new_file = sprintf("./files/attach/images/%s/%s", $args->layout_srl, $val->filename); FileHandler::copyFile($val->old_file, $new_file); $extra_vars->{$key} = $new_file; } $args->extra_vars = serialize($extra_vars); } // for header script $oModuleController->insertModulePartConfig('layout', $args->layout_srl, $layout_config); // Insert into the DB $output = $this->insertLayout($args); if (!$output->toBool()) { $oDB->rollback(); return $output; } // initiate if it is faceoff layout $this->initLayout($args->layout_srl, $args->layout); // update layout info $output = $this->updateLayout($args); if (!$output->toBool()) { $oDB->rollback(); return $output; } $this->_copyLayoutFile($layout->layout_srl, $args->layout_srl); } } $oDB->commit(); $this->setMessage('success_registed'); if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { global $lang; htmlHeader(); alertScript($lang->success_registed); reload(true); closePopupScript(); htmlFooter(); Context::close(); exit; } }
/** * Add a group of friends * @return void|Object (success : void, fail : Object) **/ function procCommunicationAddFriendGroup() { // Check login information if (!Context::get('is_logged')) { return new Object(-1, 'msg_not_logged'); } $logged_info = Context::get('logged_info'); // Variables $args->friend_group_srl = trim(Context::get('friend_group_srl')); $args->member_srl = $logged_info->member_srl; $args->title = Context::get('title'); $args->title = htmlspecialchars($args->title); if (!$args->title) { return new Object(-1, 'msg_invalid_request'); } // modify if friend_group_srl exists. if ($args->friend_group_srl) { $output = executeQuery('communication.renameFriendGroup', $args); $msg_code = 'success_updated'; // add if not exists } else { $output = executeQuery('communication.addFriendGroup', $args); $msg_code = 'success_registed'; } if (!$output->toBool()) { if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { global $lang; htmlHeader(); alertScript($lang->fail_to_registed); closePopupScript(); htmlFooter(); Context::close(); exit; } else { return $output; } } else { if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { global $lang; htmlHeader(); alertScript($lang->success_registed); reload(true); closePopupScript(); htmlFooter(); Context::close(); exit; } else { $this->setMessage($msg_code); } } }
/** * @brief List permissions of the module */ function procModuleAdminModuleGrantSetup() { $module_srls = Context::get('module_srls'); if (!$module_srls) { return new Object(-1, 'msg_invalid_request'); } $modules = explode(',', $module_srls); if (count($modules) < 1) { return new Object(-1, 'msg_invalid_request'); } $oModuleController = getController('module'); $oModuleModel = getModel('module'); $columnList = array('module_srl', 'module'); $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0], $columnList); $xml_info = $oModuleModel->getModuleActionXml($module_info->module); $grant_list = $xml_info->grant; $grant_list->access = new stdClass(); $grant_list->access->default = 'guest'; $grant_list->manager = new stdClass(); $grant_list->manager->default = 'manager'; $grant = new stdClass(); foreach ($grant_list as $grant_name => $grant_info) { // Get the default value $default = Context::get($grant_name . '_default'); // -1 = Sign only, 0 = all users $grant->{$grant_name} = array(); if (strlen($default)) { $grant->{$grant_name}[] = $default; continue; // Users in a particular group } else { $group_srls = Context::get($grant_name); if ($group_srls) { if (!is_array($group_srls)) { if (strpos($group_srls, '|@|') !== false) { $group_srls = explode('|@|', $group_srls); } elseif (strpos($group_srls, ',') !== false) { $group_srls = explode(',', $group_srls); } else { $group_srls = array($group_srls); } } $grant->{$grant_name} = $group_srls; } continue; } $grant->{$group_srls} = array(); // dead code, too?? } // Stored in the DB foreach ($modules as $module_srl) { $args = new stdClass(); $args->module_srl = $module_srl; $output = executeQuery('module.deleteModuleGrants', $args); if (!$output->toBool()) { continue; } // Permissions stored in the DB foreach ($grant as $grant_name => $group_srls) { foreach ($group_srls as $val) { $args = new stdClass(); $args->module_srl = $module_srl; $args->name = $grant_name; $args->group_srl = $val; $output = executeQuery('module.insertModuleGrant', $args); if (!$output->toBool()) { return $output; } } } } $this->setMessage('success_registed'); if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { if (Context::get('success_return_url')) { $this->setRedirectUrl(Context::get('success_return_url')); } else { global $lang; htmlHeader(); alertScript($lang->success_registed); closePopupScript(); htmlFooter(); Context::close(); exit; } } }
/** * prepares variables to use in moduleHandler * @param string $module name of module * @param string $act name of action * @param int $mid * @param int $document_srl * @param int $module_srl * @return void * */ function ModuleHandler($module = '', $act = '', $mid = '', $document_srl = '', $module_srl = '') { // If XE has not installed yet, set module as install if (!Context::isInstalled()) { $this->module = 'install'; $this->act = Context::get('act'); return; } $oContext = Context::getInstance(); if ($oContext->isSuccessInit == FALSE) { $logged_info = Context::get('logged_info'); if ($logged_info->is_admin != "Y") { $this->error = 'msg_invalid_request'; return; } } // Set variables from request arguments $this->module = $module ? $module : Context::get('module'); $this->act = $act ? $act : Context::get('act'); $this->mid = $mid ? $mid : Context::get('mid'); $this->document_srl = $document_srl ? (int) $document_srl : (int) Context::get('document_srl'); $this->module_srl = $module_srl ? (int) $module_srl : (int) Context::get('module_srl'); if ($entry = Context::get('entry')) { $this->entry = Context::convertEncodingStr($entry); } // Validate variables to prevent XSS $isInvalid = NULL; if ($this->module && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->module)) { $isInvalid = TRUE; } if ($this->mid && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->mid)) { $isInvalid = TRUE; } if ($this->act && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->act)) { $isInvalid = TRUE; } if ($isInvalid) { htmlHeader(); echo Context::getLang("msg_invalid_request"); htmlFooter(); Context::close(); exit; } if (isset($this->act) && (strlen($this->act) >= 4 && substr_compare($this->act, 'disp', 0, 4) === 0)) { if (Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && $_SERVER['HTTPS'] != 'on') { if (Context::get('_https_port') != null) { header('location:https://' . $_SERVER['HTTP_HOST'] . ':' . Context::get('_https_port') . $_SERVER['REQUEST_URI']); } else { header('location:https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); } return; } } // call a trigger before moduleHandler init ModuleHandler::triggerCall('moduleHandler.init', 'before', $this); // execute addon (before module initialization) $called_position = 'before_module_init'; $oAddonController = getController('addon'); $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? 'mobile' : 'pc'); if (file_exists($addon_file)) { include $addon_file; } }
function procAjaxboardAdminSendPush() { $message = Context::get('message'); $notice = Context::get('notice'); $receiver_srl = Context::get('receiver_srl'); $receiver_srls = Context::get('receiver_srls'); if (!$message) { return new Object(-1, 'msg_invalid_request'); } if ($notice != 'Y' && !$receiver_srl && !(is_array($receiver_srls) && count($receiver_srls))) { return new Object(-1, 'msg_not_exists_member'); } if ($notice == 'Y') { $oAjaxboardModel = getModel('ajaxboard'); $module_config = $oAjaxboardModel->getConfig(); $args = array('type' => 'noticeOfServer', 'receiver_tokens' => $module_config->token, 'message' => $message); } else { if ($receiver_srl) { $oMemberModel = getModel('member'); $receiver_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl); if ($receiver_info->member_srl != $receiver_srl) { return new Object(-1, 'msg_not_exists_member'); } $args = array('type' => 'notice', 'receiver_srls' => $receiver_srl, 'message' => $message); } else { $message = nl2br(htmlspecialchars($message, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); $receiver_srls = implode(',', $receiver_srls); $args = array('type' => 'notice', 'receiver_srls' => $receiver_srls, 'message' => $message); } } $oAjaxboardController = getController('ajaxboard'); $oAjaxboardController->emitEvent($args); if (Context::get('is_popup') != 'Y') { $this->setMessage('success_sended'); $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAjaxboardAdminSendPush')); } else { htmlHeader(); alertScript(Context::getLang('success_sended')); closePopupScript(); htmlFooter(); Context::close(); exit; } }
<a href="/finansovie_uslugi.php#cash_pay" class="linkMap3 fontNormal fontChangeNormalMedium">Прием наложенных платежей</a><br> <a href="/finansovie_uslugi.php#mobile" class="linkMap3 fontNormal fontChangeNormalMedium">Мобильный эквайринг</a> </div> <div class="col-xs-12 col-md-2"> <a href="/klientam.php" class="linkMap1 fontMedium fontChangeMediumSuperBig">Клиентам</a><br> <a href="/klientam.php" class="linkMap2 fontSubMedium fontChangeSubMediumBig">Стать клиентом</a><br> <a href="/klientam.php#faq" class="linkMap2 fontSubMedium fontChangeSubMediumBig">Вопросы и ответы</a><br> <a href="/klientam.php#int" class="linkMap2 fontSubMedium fontChangeSubMediumBig">Интеграция</a><br> </div> <div class="col-xs-12 col-md-2"> <a href="/poluchateliam_zakazov.php" class="linkMap1 fontMedium fontChangeMediumSuperBig">Получателям заказов</a><br> <a href="/poluchateliam_zakazov.php" class="linkMap2 fontSubMedium fontChangeSubMediumBig">Отследить посылку</a><br> <a href="/poluchateliam_zakazov.php#faq" class="linkMap2 fontSubMedium fontChangeSubMediumBig">Впоросы и ответы</a><br> </div> <div class="col-xs-12 col-md-2"> <a href="/kalkulator.php" class="linkMap1 fontMedium fontChangeMediumSuperBig">Калькулятор</a> </div> <div class="col-xs-12 col-md-2"> <a href="/kontakty.php" class="linkMap1 fontMedium fontChangeMediumSuperBig">Контакты</a> </div> <div class="col-xs-0 col-md-1"></div> </div> </div> </div> </section> <?htmlFooter()?> </body> </html>
<div id="header"> POIs viewer </div> <div id="mainContainer"> <div id="mapTools"> </div> <div id="mapContainer"> </div> <div id="console"> <div id="consoleHeader" onclick="showConsole( false );" title="hide console"> >>>> </div> ready </div> <div id="consoleReveal" onclick="showConsole( true );"> <img src="img/console.png" alt="console" title="view console" /> </div> </div> <div style="color:#FFF;"> </div> <?php echo getJsIcons(); echo htmlFooter();
require __DIR__ . '/init.php'; htmlHeader(); // create a client instance $client = new Solarium\Client($config); // get a select query instance $query = $client->createSelect(); // add distributed search settings // see http://wiki.apache.org/solr/DistributedSearch#Distributed_Search_Example for setting up two solr instances $distributedSearch = $query->getDistributedSearch(); $distributedSearch->addShard('shard1', 'localhost:8983/solr'); $distributedSearch->addShard('shard2', 'localhost:7574/solr'); // this executes the query and returns the result $resultset = $client->select($query); // display the total number of documents found by solr echo 'NumFound: ' . $resultset->getNumFound(); // show documents using the resultset iterator foreach ($resultset as $document) { echo '<hr/><table>'; // the documents are also iterable, to get all fields foreach ($document as $field => $value) { // this converts multivalue fields to a comma-separated string if (is_array($value)) { $value = implode(', ', $value); } echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>'; } echo '</table>'; } htmlFooter();
/** * layout copy * @return void */ function procLayoutAdminCopyLayout() { $sourceArgs = Context::getRequestVars(); if ($sourceArgs->layout == 'faceoff') { return $this->stop('not supported'); } if (!$sourceArgs->layout_srl) { return $this->stop('msg_empty_origin_layout'); } if (!is_array($sourceArgs->title) || count($sourceArgs->title) == 0) { return $this->stop('msg_empty_target_layout'); } $oLayoutModel =& getModel('layout'); $layout = $oLayoutModel->getLayout($sourceArgs->layout_srl); $args->extra_vars = $oLayoutModel->getLayoutRawData($sourceArgs->layout_srl, array('extra_vars')); $extra_vars = unserialize($args->extra_vars); $oModuleController =& getController('module'); $layout_config->header_script = $extra_vars->header_script; // Get information to create a layout $args->site_srl = (int) $layout->site_srl; $args->layout = $layout->layout; $args->layout_type = $layout->type; if (!$args->layout_type) { $args->layout_type = "P"; } $oDB =& DB::getInstance(); $oDB->begin(); if (is_array($sourceArgs->title)) { foreach ($sourceArgs->title as $key => $value) { if (!trim($value)) { continue; } $args->layout_srl = getNextSequence(); $args->title = $value; // for header script $oModuleController->insertModulePartConfig('layout', $args->layout_srl, $layout_config); // Insert into the DB $output = $this->insertLayout($args); if (!$output->toBool()) { $oDB->rollback(); return $output; } // initiate if it is faceoff layout $this->initLayout($args->layout_srl, $args->layout); // update layout info $output = $this->updateLayout($args); if (!$output->toBool()) { $oDB->rollback(); return $output; } $this->_copyLayoutFile($layout->layout_srl, $args->layout_srl); } } $oDB->commit(); $this->setMessage('success_registed'); if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { global $lang; htmlHeader(); alertScript($lang->success_registed); reload(true); closePopupScript(); htmlFooter(); Context::close(); exit; } }