本文整理汇总了PHP中isc_strpos函数的典型用法代码示例。如果您正苦于以下问题:PHP isc_strpos函数的具体用法?PHP isc_strpos怎么用?PHP isc_strpos使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isc_strpos函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SaveConfiguration
/**
* Validate and save the exporter configuration.
*
* @param string Any error message encountered (passed back by reference)
* @return mixed False on failure, if successful, array of configuration information to save.
*/
function SaveConfiguration(&$err)
{
if (!isset($_POST['path'])) {
$err = GetLang('NoOsCommercePath');
return false;
}
if (isc_strpos($_POST['path'], 'http://') === 0 || isc_strpos($_POST['path'], 'https://') === 0) {
$path = $this->URLToPath($_POST['path'], $err);
if (!$path) {
return false;
}
} else {
$path = realpath(APP_ROOT . "/../" . $_POST['path']);
$path = preg_replace("#[^a-z0-9\\./\\:]#i", "", $path);
}
if (!is_dir($path) || !file_exists($path . "/includes/configure.php")) {
$err = sprintf(GetLang('InvalidOsCommercePath'), isc_html_escape($_POST['path']), isc_html_escape($_POST['path']));
return false;
} else {
// Grab the default OsCommerce language
require $path . "/includes/configure.php";
$GLOBALS['OSCOMMERCE_DB'] =& new MySQLDB();
$connection = $GLOBALS['OSCOMMERCE_DB']->Connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE);
if (!$connection) {
list($error, $level) = $db->GetError();
trigger_error($error, $level);
}
$query = "select languages_id from languages order by sort_order asc limit 1";
$result = $GLOBALS['OSCOMMERCE_DB']->Query($query);
$language_id = $GLOBALS['OSCOMMERCE_DB']->FetchOne($result);
return array("path" => $path, "language" => $language_id);
}
}
示例2: SaveConfiguration
/**
* Validate and save the exporter configuration.
*
* @param string Any error message encountered (passed back by reference)
* @return mixed False on failure, if successful, array of configuration information to save.
*/
function SaveConfiguration(&$err)
{
if (!isset($_POST['xcart_path'])) {
$err = GetLang('NoXCartPath');
return false;
}
if (isc_strpos($_POST['xcart_path'], 'http://') === 0 || isc_strpos($_POST['xcart_path'], 'https://') === 0) {
$path = $this->URLToPath($_POST['xcart_path'], $err);
if (!$path) {
return false;
}
} else {
$path = realpath(APP_ROOT . "/../" . $_POST['xcart_path']);
$path = preg_replace("#[^a-z0-9\\./\\:]#i", "", $path);
}
if (!is_dir($path) || !file_exists($path . "/config.php")) {
$err = sprintf(GetLang('InvalidXCartPath'), isc_html_escape($_POST['xcart_path']), isc_html_escape($_POST['xcart_path']));
return false;
} else {
// Grab the default X-Cart language
if (!defined("XCART_START")) {
define("XCART_START", 1);
}
$xcart_dir = $path;
require $path . "/config.php";
$GLOBALS['XCART_DB'] =& new MySQLDB();
$connection = $GLOBALS['XCART_DB']->Connect($sql_host, $sql_user, $sql_password, $sql_db);
// Modify the structure of the X-Cart customers table so we can store users' email addresses in it
$GLOBALS['XCART_DB']->Query("ALTER TABLE xcart_customers CHANGE login login varchar(200) NOT NULL default ''");
return array("path" => $path, "blowfish_key" => $blowfish_key);
}
}
示例3: TestNotificationForm
/**
* Test the notification method by displaying a simple HTML form
*/
public function TestNotificationForm()
{
// Set some test variables
$this->SetOrderId(99999);
$this->SetOrderTotal(139.5);
$this->SetOrderNumItems(3);
// Send the email message
$result = $this->SendNotification();
if ($result['outcome'] == "success") {
$GLOBALS['Icon'] = "success";
// How many recipients was it sent to?
if (is_numeric(isc_strpos($this->_email, ","))) {
// There are multiple email addresses
$tmp_emails = explode(",", $this->_email);
$num_emails = count($tmp_emails);
$success_msg = sprintf(GetLang('NEmailTestSuccessX'), $num_emails);
} else {
// Just one recipient
$success_msg = GetLang('NEmailTestSuccess');
}
$GLOBALS['EmailResultMessage'] = sprintf($success_msg, $this->_email);
} else {
$GLOBALS['Icon'] = "error";
$GLOBALS['EmailResultMessage'] = sprintf(GetLang('NEmailTestFail'), $this->_email, $result['message']);
}
$this->ParseTemplate("module.email.test");
}
示例4: redisPatternToMysql
/**
* Convert a redis-like key pattern to mysql =, LIKE or REGEXP syntax
*
* @param string $pattern
* @return string
*/
protected function redisPatternToMysql($pattern)
{
// incoming key patterns are redis-like, convert to mysql equivalent
if ($pattern == '*') {
// shortcut to all keys
return '';
}
if (isc_strpos($pattern, '[') !== false && isc_strpos($pattern, ']') !== false) {
// need to use regex
$pattern = "^" .strtr($pattern, array(
'*' => '.*',
'?' => '.',
)) . "$";
$pattern = "REGEXP '" . $this->db->Quote($pattern) . "'";
}
else if (isc_strpos($pattern, '*') !== false || isc_strpos($pattern, '?') !== false) {
// no [character] specifiers, can use LIKE
$pattern = strtr($pattern, array(
'%' => '\%',
'_' => '\_',
'*' => '%',
'?' => '_',
));
$pattern = "LIKE '" . $this->db->Quote($pattern) . "'";
}
else
{
// no pattern specified, can use =
$pattern = "= '" . $this->db->Quote($pattern) . "'";
}
return $pattern;
}
示例5: AddonsModuleIsEnabled
/**
* Check if a particular addon module is enabled.
*
* @param string The ID of the addon module.
* @return boolean True if the addon is enabled, false if not.
*/
function AddonsModuleIsEnabled($id)
{
if (is_numeric(isc_strpos(GetConfig('AddonModules'), $id))) {
return true;
} else {
return false;
}
}
示例6: SaveConfiguration
/**
* Validate and save the importer configuration.
*
* @param string Any error message encountered (passed back by reference)
* @return mixed False on failure, if successful, array of configuration information to save.
*/
function SaveConfiguration(&$err)
{
if (!isset($_POST['path'])) {
$err = GetLang('NoZenCartPath');
return false;
}
if (isc_strpos($_POST['path'], 'http://') === 0 || isc_strpos($_POST['path'], 'https://') === 0) {
$path = $this->URLToPath($_POST['path'], $err);
if (!$path) {
return false;
}
} else {
$path = realpath(APP_ROOT . "/../" . $_POST['path']);
$path = preg_replace("#[^a-z0-9\\./\\:]#i", "", $path);
}
if (!is_dir($path) || !file_exists($path . "/includes/configure.php")) {
$err = sprintf(GetLang('InvalidZenCartPath'), isc_html_escape($_POST['path']), isc_html_escape($_POST['path']));
return false;
} else {
// Grab the default ZenCart language
require $path . "/includes/configure.php";
if (!defined('DB_PREFIX')) {
define('DB_PREFIX', '');
}
$GLOBALS['ZENCART_DB'] = new MySQLDB();
$GLOBALS['ZENCART_DB']->TablePrefix = DB_PREFIX;
$connection = $GLOBALS['ZENCART_DB']->Connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE);
if (!$connection) {
list($error, $level) = $db->GetError();
trigger_error($error, $level);
}
$query = "select languages_id from [|PREFIX|]languages order by sort_order asc limit 1";
$result = $GLOBALS['ZENCART_DB']->Query($query);
$language_id = $GLOBALS['ZENCART_DB']->FetchOne($result);
// Get the collation/character set of one of the ZenCart tables to use as a base
$query = "SHOW CREATE TABLE [|PREFIX|]customers";
$result = $GLOBALS['ZENCART_DB']->Query($query);
$tableStructure = $GLOBALS['ZENCART_DB']->Fetch($result);
$tableStructure = array_pop($tableStructure);
$chartset = '';
preg_match("#CHARSET=([a-zA-Z0-9_]+)\\s?#i", $tableStructure, $matches);
if (isset($matches[1]) && $matches[1] != '') {
$charset = $matches[1];
}
return array("path" => $path, "language" => $language_id, "charset" => $charset);
}
}
示例7: SaveConfiguration
/**
* Validate and save the exporter configuration.
*
* @param string Any error message encountered (passed back by reference)
* @return mixed False on failure, if successful, array of configuration information to save.
*/
function SaveConfiguration(&$err)
{
if (!isset($_POST['cubecart4_path'])) {
$err = GetLang('NoCubeCartPath');
return false;
}
if (isc_strpos($_POST['cubecart4_path'], 'http://') === 0 || isc_strpos($_POST['cubecart4_path'], 'https://') === 0) {
$path = $this->URLToPath($_POST['cubecart4_path'], $err);
if (!$path) {
return false;
}
} else {
$path = realpath(APP_ROOT . "/../" . $_POST['cubecart4_path']);
$path = preg_replace("#[^a-z0-9\\./\\:]#i", "", $path);
}
if (!is_dir($path) || !file_exists($path . "/includes/global.inc.php")) {
$err = sprintf(GetLang('InvalidCubeCartPath'), isc_html_escape($_POST['cubecart4_path']), isc_html_escape($_POST['cubecart4_path']));
return false;
} else {
return array("path" => $path);
}
}
示例8: SendNotification
/**
* Send the order notification SMS text message
*/
public function SendNotification()
{
// Load up the variables for the SMS gateway
$this->_username = $this->GetValue("username");
$this->_password = $this->GetValue("password");
$this->_cellnumber = $this->GetValue("cellnumber");
$this->_message = $this->BuildSmsMessage();
$sms_url = sprintf("http://www.smsglobal.com.au/http-api.php?action=sendsms&user=%s&password=%s&from=%s&to=%s&clientcharset=UTF-8&text=%s", $this->_username, $this->_password, $this->_cellnumber, $this->_cellnumber, urlencode($this->_message));
// Let's try to send the message
$result = PostToRemoteFileAndGetResponse($sms_url);
if (is_numeric(isc_strpos($result, "OK"))) {
$result = array("outcome" => "success", "message" => sprintf(GetLang('SMSNotificationSentNumber'), $this->_cellnumber));
} else {
// The message couldn't be sent. Do they have enough credit?
$low_balance = false;
$bal_url = sprintf("http://www.smsglobal.com.au/http-api.php?action=balancesms&user=%s&password=%s", $this->_username, $this->_password);
$bal_result = PostToRemoteFileAndGetResponse($bal_url);
// SMSGlobal returns the balance in the format: BALANCE: 0.0999999; USER: johndoe
$bal_data = explode(";", $bal_result);
if (is_array($bal_data) && count($bal_data) > 1) {
$bal_data_1 = explode(":", $bal_data[0]);
if (is_array($bal_data_1)) {
$balance = floor((int) trim($bal_data_1[1]));
if ($balance == 0) {
$low_balance = true;
}
}
}
if ($low_balance) {
$error_message = GetLang('SMSZeroBalance');
} else {
$error_message = $bal_result;
}
$result = array("outcome" => "fail", "message" => $error_message);
}
return $result;
}
示例9: ManageBackups
public function ManageBackups($MsgDesc = "", $MsgStatus = "")
{
if(isset($_GET['complete'])) {
$MsgStatus = MSG_SUCCESS;
if($_GET['complete'] == "remote") {
$MsgDesc = GetLang('RemoteBackupComplete');
} else {
$MsgDesc = sprintf(GetLang('LocalBackupComplete'), $_GET['complete']);
}
}
else if(isset($_GET['failed'])) {
$MsgStatus = MSG_ERROR;
if($_GET['failed'] == 'local') {
$MsgDesc = GetLang('LocalBackupFailed');
} else {
$MsgDesc = GetLang('RemoteBackupFailed');
}
}
if($MsgDesc != "") {
$GLOBALS["Message"] = MessageBox($MsgDesc, $MsgStatus);
}
$dir = realpath(ISC_BACKUP_DIRECTORY);
$dir = isc_substr($dir, isc_strpos($dir, realpath(ISC_BASE_PATH)));
$backups = $this->_GetBackupList();
$GLOBALS['BackupGrid'] = '';
// Loop through all of the existing backups
foreach($backups as $file => $details) {
$GLOBALS['FileName'] = isc_html_escape($file);
$GLOBALS['ModifiedTime'] = Store_DateTime::niceTime($details['mtime']);
if(isset($details['directory'])) {
$GLOBALS['FileSize'] = "N/A";
$GLOBALS['DownloadOpen'] = GetLang('OpenBackup');
$GLOBALS['BackupImage'] = "backup_folder";
$GLOBALS['BackupType'] = GetLang('BackupFolder');
$GLOBALS['ViewLink'] = "backups/" . $GLOBALS['FileName'];
}
else {
$GLOBALS['FileSize'] = Store_Number::niceSize($details['size']);
$GLOBALS['DownloadOpen'] = GetLang('DownloadBackup');
$GLOBALS['BackupImage'] = "backup";
$GLOBALS['BackupType'] = GetLang('BackupFile');
$GLOBALS['ViewLink'] = "index.php?ToDo=viewBackup&file=" . $GLOBALS['FileName'];
}
$GLOBALS["BackupGrid"] .= $this->template->render('backup.manage.row.tpl');
}
if($GLOBALS['BackupGrid'] == "") {
$GLOBALS['DisplayGrid'] = "none";
$GLOBALS["Message"] = MessageBox(GetLang('NoBackups'), MSG_SUCCESS);
$GLOBALS["DisableDelete"] = "DISABLED";
}
$this->template->display('backups.manage.tpl');
}
示例10: ExportCSV
/**
* ExportCSV
* Grab all products and create the CSV file to output
*
* @return Void
*/
public function ExportCSV()
{
$this->init();
$cat_ids = "";
$csv = "";
if(isset($_POST['category']) && isset($_POST['title']) && isset($_POST['desc1']) && isset($_POST['desc2']) && isset($_POST['displayurl']) && isset($_POST['destinationurl'])) {
$all_fields = $_POST['title'] . $_POST['desc1'] . $_POST['desc2'] . $_POST['displayurl'] . $_POST['destinationurl'];
if(count($_POST['category']) == 1 && in_array(0, $_POST['category'])) {
// Export all products
}
else {
// Only export the selected categories
foreach($_POST['category'] as $cat_id) {
if($cat_id != 0) {
$cat_ids .= $cat_id . ",";
}
}
$cat_ids = rtrim($cat_ids, ",");
}
$query = "select p.productid, p.prodname, p.tax_class_id ";
// Do we need to get the product's brand?
if(is_numeric(isc_strpos($all_fields, "{PRODBRAND}"))) {
$query .= "(select brandname from [|PREFIX|]brands where brandid=p.prodbrandid) as prodbrand";
}
// Do we need to get the product's summary?
if(is_numeric(isc_strpos($all_fields, "{PRODSUMMARY}"))) {
//$query .= "substring(proddesc from 1 for 100) as prodsummary, ";
$query .= ", proddesc as prodsummary ";
}
// Do we need to get the product's price?
if(is_numeric(isc_strpos($all_fields, "{PRODPRICE}"))) {
$query .= ", p.prodcalculatedprice as prodprice ";
}
// Do we need to get the product's SKU?
if(is_numeric(isc_strpos($all_fields, "{PRODSKU}"))) {
$query .= ", p.prodcode as prodsku ";
}
// Do we need to get the product's category?
if(is_numeric(isc_strpos($all_fields, "{PRODCAT}"))) {
$query .= "(select catname from [|PREFIX|]categoryassociations ca inner join [|PREFIX|]categories c on ca.categoryid=c.categoryid where ca.productid=p.productid limit 1) as prodcat ";
}
$cat_ids = rtrim($cat_ids, ", ");
$query .= " from [|PREFIX|]products p ";
// Do we need to filter on category?
if($cat_ids != "") {
$query .= sprintf("inner join [|PREFIX|]categoryassociations ca on p.productid=ca.productid where ca.categoryid in (%s)", $cat_ids);
}
// Build the headers for the CSV file
$csv .= $this->_HeaderRow();
// Build the campaign row
$csv .= $this->_CampaignRow();
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$csv .= $this->_CreateRecord($row);
}
// Flush the buffer
ob_end_clean();
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=\"ysm-".isc_date("Y-m-d").".csv\";");
header("Content-Length: " . strlen($csv));
echo $csv;
// Let the parent class know the addon's just been executed
parent::LogAction();
exit;
}
else {
// Bad form details
//.........这里部分代码省略.........
示例11: GetQuote
//.........这里部分代码省略.........
$usps_xml = preg_replace("#<Length>(.*)</Length>#si", "", $usps_xml);
$usps_xml = preg_replace("#<Height>(.*)</Height>#si", "", $usps_xml);
$usps_xml = preg_replace("#<Girth>(.*)</Girth>#si", "", $usps_xml);
$usps_xml = preg_replace("#<FirstClassMailType>(.*)</FirstClassMailType>#si", "", $usps_xml);
$usps_xml = preg_replace("#<Machinable>(.*)</Machinable>#si", "", $usps_xml);
}
// Connect to USPS to retrieve a live shipping quote
$result = "";
$valid_quote = false;
// Should we test on the test or production server?
$usps_mode = $this->GetValue("servertype");
if ($usps_mode == "test") {
$usps_url = "http://testing.shippingapis.com/ShippingAPITest.dll?";
} else {
$usps_url = "http://production.shippingapis.com/ShippingAPI.dll?";
}
$post_vars = implode("&", array("API={$this->_api}", "XML={$usps_xml}"));
if (function_exists("curl_exec")) {
// Use CURL if it's available
$ch = @curl_init($usps_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_vars);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Setup the proxy settings if there are any
if (GetConfig('HTTPProxyServer')) {
curl_setopt($ch, CURLOPT_PROXY, GetConfig('HTTPProxyServer'));
if (GetConfig('HTTPProxyPort')) {
curl_setopt($ch, CURLOPT_PROXYPORT, GetConfig('HTTPProxyPort'));
}
}
if (GetConfig('HTTPSSLVerifyPeer') == 0) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
}
$result = curl_exec($ch);
if ($result != "") {
$valid_quote = true;
}
}
$this->DebugLog($result);
if ($valid_quote) {
// Was the user authenticated?
if (is_numeric(isc_strpos($result, "Authorization failure"))) {
$this->SetError(GetLang('USPSAuthError'));
return false;
} else {
$xml = xmlize($result);
// Are we dealing with a domestic or international shipment?
if (isset($xml['RateV3Response'])) {
// Domestic
if (is_numeric(isc_strpos($result, "Error"))) {
// Bad quote
$this->SetError($xml['RateV3Response']["#"]['Package'][0]["#"]['Error'][0]["#"]['Description'][0]["#"]);
return false;
} else {
// Create a quote object
$quote = new ISC_SHIPPING_QUOTE($this->GetId(), $this->GetDisplayName(), $xml['RateV3Response']["#"]['Package'][0]["#"]['Postage'][0]["#"]['Rate'][0]["#"], $xml['RateV3Response']["#"]['Package'][0]["#"]['Postage'][0]["#"]['MailService'][0]["#"]);
return $quote;
}
} else {
if (isset($xml['IntlRateResponse'])) {
// International
if (is_numeric(isc_strpos($result, "Error"))) {
// Bad quote
$this->SetError($xml['IntlRateResponse']["#"]['Package'][0]["#"]['Error'][0]["#"]['Description'][0]["#"]);
return false;
} else {
// Success
$QuoteList = array();
$USPSServices = $xml['IntlRateResponse']["#"]['Package'][0]["#"]['Service'];
// get the list of enabled services
$services = $this->GetIntlServices($this->_service);
foreach ($USPSServices as $Service) {
$serviceId = $Service['@']['ID'];
// check if this service is enabled
if (!in_array($serviceId, $services)) {
continue;
}
// Create a quote object
$quote = new ISC_SHIPPING_QUOTE($this->GetId(), $this->GetDisplayName(), $Service["#"]['Postage'][0]["#"], GetLang('USPSIntlService_' . $serviceId));
//save quotes in an array
$QuoteList[] = $quote;
}
return $QuoteList;
}
} else {
if (isset($xml['Error'])) {
// Error
$this->SetError($xml['Error']["#"]['Description'][0]["#"]);
return false;
}
}
}
}
} else {
// Couldn't get to USPS
$this->SetError(GetLang('USPSOpenError'));
return false;
}
}
示例12: _BuildTabMenu
//.........这里部分代码省略.........
'show' => in_array(AUTH_Statistics_Search, $arrPermissions),
),
),
),
);
// Now that we've loaded the default menu, let's check if there are any addons we need to load
$this->_LoadAddons($menuItems);
$imagesDir = dirname(__FILE__).'/../../images';
$menu = "\n".'<div id="Menu">'."\n".'<ul>'."\n";
foreach ($menuItems as $tabName => $link) {
// By default we wont highlight this tab
$highlight_tab = false;
if ($link['match'] && isset($_REQUEST['ToDo'])) {
// If the URI matches the "match" index, we'll highlight the tab
$page = @isc_strtolower($_REQUEST['ToDo']);
if(isset($GLOBALS['HighlightedMenuItem']) && $GLOBALS['HighlightedMenuItem'] == $tabName) {
$highlight_tab = true;
}
// Does it need to match mutiple words?
if (is_array($link['match'])) {
foreach ($link['match'] as $match_it) {
if ($match_it == "") {
continue;
}
if (is_numeric(isc_strpos($page, isc_strtolower($match_it)))) {
$highlight_tab = true;
}
}
} else {
if (is_numeric(isc_strpos($page, $link['match']))) {
$highlight_tab = true;
}
}
if(isset($link['ignore']) && is_array($link['ignore'])) {
foreach($link['ignore'] as $ignore) {
if(isc_strpos($page, strtolower($ignore)) !== false) {
$highlight_tab = false;
}
}
}
}
// If the menu has sub menus, display them
if (is_array($link['items'])) {
$firstItem = true;
$mainMenuLink = '';
$subMenuList = '';
foreach ($link['items'] as $id => $sub) {
if (is_numeric($id)) {
// If the child is forbidden by law, hide it
if (@!$sub['show']) {
continue;
}
if($firstItem) {
示例13: EditPageStep1
private function EditPageStep1($MsgDesc = "", $MsgStatus = "", $IsError = false)
{
$GLOBALS['Message'] = '';
if($MsgDesc != "") {
$GLOBALS['Message'] .= MessageBox($MsgDesc, $MsgStatus);
}
$GLOBALS['Message'] .= GetFlashMessageBoxes();
$pageId = (int)$_REQUEST['pageId'];
$arrData = array();
if(PageExists($pageId)) {
// Was the page submitted with a duplicate page name?
if($IsError) {
$this->_GetPageData(0, $arrData);
}
else {
$this->_GetPageData($pageId, $arrData);
}
$GLOBALS['CurrentTab'] = '0';
if(isset($_REQUEST['currentTab'])) {
$GLOBALS['CurrentTab'] = $_REQUEST['currentTab'];
}
// Does this user have permission to edit this product?
if($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $arrData['pagevendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
FlashMessage(GetLang('Unauthorized'), MSG_ERROR, 'index.php?ToDo=viewPages');
}
$GLOBALS['PageId'] = (int) $pageId;
$GLOBALS['SetupType'] = sprintf("SwitchType(%d);", $arrData['pagetype']);
$GLOBALS['Title'] = GetLang('EditPage');
$GLOBALS['FormAction'] = "editPage2";
$GLOBALS['PageTitle'] = isc_html_escape($arrData['pagetitle']);
$wysiwygOptions = array(
'id' => 'wysiwyg',
'value' => $arrData['pagecontent']
);
$GLOBALS['WYSIWYG'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor($wysiwygOptions);
$GLOBALS['PageLink'] = isc_html_escape($arrData['pagelink']);
$GLOBALS['PageFeed'] = isc_html_escape($arrData['pagefeed']);
$GLOBALS['PageEmail'] = isc_html_escape($arrData['pageemail']);
$GLOBALS['ParentPageOptions'] = $this->GetParentPageOptions($arrData['pageparentid'], $pageId, $arrData['pagevendorid']);
$GLOBALS['PageKeywords'] = isc_html_escape($arrData['pagekeywords']);
$GLOBALS['PageMetaTitle'] = isc_html_escape($arrData['pagemetatitle']);
$GLOBALS['PageDesc'] = isc_html_escape($arrData['pagedesc']);
$GLOBALS['PageSearchKeywords'] = isc_html_escape($arrData['pagesearchkeywords']);
$GLOBALS['PageSort'] = (int) $arrData['pagesort'];
if($arrData['pagestatus'] == 1) {
$GLOBALS['Visible'] = 'checked="checked"';
}
if($arrData['pagecustomersonly'] == 1) {
$GLOBALS['IsCustomersOnly'] = "checked=\"checked\"";
}
if(is_numeric(isc_strpos($arrData['pagecontactfields'], "fullname"))) {
$GLOBALS['IsContactFullName'] = 'checked="checked"';
}
if(is_numeric(isc_strpos($arrData['pagecontactfields'], "companyname"))) {
$GLOBALS['IsContactCompanyName'] = 'checked="checked"';
}
if(is_numeric(isc_strpos($arrData['pagecontactfields'], "phone"))) {
$GLOBALS['IsContactPhone'] = 'checked="checked"';
}
if(is_numeric(isc_strpos($arrData['pagecontactfields'], "orderno"))) {
$GLOBALS['IsContactOrderNo'] = 'checked="checked"';
}
if(is_numeric(isc_strpos($arrData['pagecontactfields'], "rma"))) {
$GLOBALS['IsContactRMA'] = 'checked="checked"';
}
// Is this page the default home page?
if($arrData['pageishomepage'] == 1) {
$GLOBALS['IsHomePage'] = 'checked="checked"';
}
$GLOBALS['IsVendor'] = 'false';
if(!gzte11(ISC_HUGEPRINT)) {
$GLOBALS['HideVendorOption'] = 'display: none';
}
else {
$vendorData = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendor();
if(isset($vendorData['vendorid'])) {
$GLOBALS['HideVendorSelect'] = 'display: none';
$GLOBALS['IsVendor'] = 'true';
$GLOBALS['CurrentVendor'] = isc_html_escape($vendorData['vendorname']);
}
else {
$GLOBALS['HideVendorLabel'] = 'display: none';
//.........这里部分代码省略.........
示例14: UpdateLayoutPanels
/**
* DesignMode::UpdateLayoutPanels()
*
* @return
*/
protected function UpdateLayoutPanels()
{
$FileContent = "";
$LayoutFile = $this->FileName;
$PanelString = $this->PanelString;
// we need to put the columns into an associative array
$cols = explode("|", $PanelString);
foreach ($cols as $key => $val) {
if($val == '') {
unset($cols[$key]);
}
}
foreach($cols as $key => $val) {
$PanelSplit = explode(":", $val);
$Columns[$PanelSplit[0]] = explode(",",$PanelSplit[1]);
}
$LayoutFilePath = str_replace('//', '/', $this->templateDirectories[count($this->templateDirectories)-1].'/'.$LayoutFile);
$MasterLayoutFilePath = '';
$sortedDirectories = array_reverse($this->templateDirectories);
foreach($sortedDirectories as $directory) {
if(file_exists($directory.'/'.$LayoutFile)) {
$MasterLayoutFilePath = $directory.'/'.$LayoutFile;
break;
}
}
// File doesn't exist in the local template and in the master template. Exit
if((!$MasterLayoutFilePath || !file_exists($MasterLayoutFilePath)) && !file_exists($LayoutFilePath)) {
return false;
}
// File doesn't exist in the local template, we need to create it
if(!file_exists($LayoutFilePath)) {
$parentDir = dirname($LayoutFilePath);
if(!is_dir($parentDir) && !isc_mkdir($parentDir, ISC_WRITEABLE_DIR_PERM, true)) {
$this->SetError($LayoutFilePath);
return false;
}
if(!@touch($LayoutFilePath)) {
$this->SetError($LayoutFilePath);
return false;
}
$FileContent = file_get_contents($MasterLayoutFilePath);
}
else {
$FileContent = file_get_contents($LayoutFilePath);
}
foreach($Columns as $PanelName => $PanelList) {
// we need to get the content between a div, but there might be sub-divs that we still want included...
// we do this loop to get the whole bit of the correct div
$inDivCount = 0;
$position = 0;
$count = 0;
$LastReplace = '';
$LastPosition = '';
$found_gt = false; // gt = greater than
$divPos = isc_strpos($FileContent, $PanelName);
$size = isc_strlen($FileContent);
// start the loop through the html to get it all
for($i = $divPos; $i < $size; ++$i) {
if($found_gt == false) {
if($FileContent[$i] == ">") {
// we found the end of the starting div tag, now we can search for the correct </div>
$found_gt = true;
$start_pos = $i+1;
}
} else {
// looping through the content
if($FileContent[$i] == "<") {
if($FileContent[$i+1].$FileContent[$i+2].$FileContent[$i+3].$FileContent[$i+4] == "/div") {
// we've found a closing div!
if($inDivCount == 0) {
// we found the end! hooray!
$end_pos = $i;
break;
} else {
// we're in a sub-div, but it closed! =D
--$inDivCount;
}
} elseif($FileContent[$i+1].$FileContent[$i+2].$FileContent[$i+3] == "div") {
// found a sub-div, up the count =(
++$inDivCount;
}
}
}
}
//.........这里部分代码省略.........
示例15: BuildPaginationUrl
function BuildPaginationUrl($url, $page)
{
if (isc_strpos($url, "{page}") === false) {
if (isc_strpos($url, "?") === false) {
$url .= "?";
} else {
$url .= "&";
}
$url .= "page={$page}";
} else {
$url = str_replace("{page}", $page, $url);
}
return $url;
}