本文整理汇总了PHP中Tools::stripslashes方法的典型用法代码示例。如果您正苦于以下问题:PHP Tools::stripslashes方法的具体用法?PHP Tools::stripslashes怎么用?PHP Tools::stripslashes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tools
的用法示例。
在下文中一共展示了Tools::stripslashes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfigFieldsValues
/**
* Asign value for each input of Data form
*/
public function getConfigFieldsValues($data = null)
{
$languages = Language::getLanguages(false);
$fields_values = array();
$obj = isset($data['params']) ? $data['params'] : array();
foreach ($this->fields_form as $k => $f) {
foreach ($f['form']['input'] as $j => $input) {
if (isset($input['lang'])) {
foreach ($languages as $lang) {
$fields_values[$input['name']][$lang['id_lang']] = isset($obj[$input['name'] . '_' . $lang['id_lang']]) ? Tools::stripslashes($obj[$input['name'] . '_' . $lang['id_lang']]) : $input['default'];
}
} else {
if (isset($obj[trim($input['name'])])) {
$value = $obj[trim($input['name'])];
if ($input['name'] == 'image' && $value) {
$thumb = __PS_BASE_URI__ . 'modules/' . $this->name . '/img/' . $value;
$this->fields_form[$k]['form']['input'][$j]['thumb'] = $thumb;
}
$fields_values[$input['name']] = Tools::stripslashes($value);
} else {
$v = Tools::getValue($input['name'], Configuration::get($input['name']));
$fields_values[$input['name']] = $v ? $v : $input['default'];
}
}
}
}
if (isset($data['id_leowidgets'])) {
$fields_values['id_leowidgets'] = $data['id_leowidgets'];
}
return $fields_values;
}
示例2: renderContent
public function renderContent($args, $setting)
{
# validate module
unset($args);
$t = array('name' => '', 'html' => '');
$setting = array_merge($t, $setting);
$ac = array();
$languageID = Context::getContext()->language->id;
$text_link = $link = '';
for ($i = 1; $i <= 10; $i++) {
if (isset($setting['text_link_' . $i . '_' . $languageID]) && trim($setting['text_link_' . $i . '_' . $languageID])) {
$text_link = isset($setting['text_link_' . $i . '_' . $languageID]) ? html_entity_decode($setting['text_link_' . $i . '_' . $languageID], ENT_QUOTES, 'UTF-8') : 'No Link Title';
if (isset($setting['link_' . $i . '_' . $languageID])) {
$link = trim($setting['link_' . $i . '_' . $languageID]);
} else {
$link = trim($setting['link_' . $i]);
}
$ac[] = array('text' => Tools::stripslashes($text_link), 'link' => $link);
}
}
$setting['id'] = rand();
$setting['links'] = $ac;
//echo '<pre>';print_r($setting);die;
$output = array('type' => 'links', 'data' => $setting);
return $output;
}
示例3: renderContent
public function renderContent($args, $setting)
{
# validate module
unset($args);
$header = '';
$content = '';
$cs = array();
$languageID = Context::getContext()->language->id;
for ($i = 1; $i <= $setting['nbcusthtml']; $i++) {
$title = isset($setting['title_' . $i . '_' . $languageID]) ? $setting['title_' . $i . '_' . $languageID] : '';
$header = isset($setting['header_' . $i . '_' . $languageID]) ? $setting['header_' . $i . '_' . $languageID] : '';
if (!empty($header) && !empty($title)) {
$content = isset($setting['content_' . $i . '_' . $languageID]) ? Tools::stripslashes($setting['content_' . $i . '_' . $languageID]) : '';
$cs[] = array('title' => trim($title), 'header' => trim($header), 'content' => trim($content));
}
}
if ($setting['auto_play']) {
$setting['interval'] = isset($setting['interval']) ? (int) $setting['interval'] : 4000;
} else {
$setting['interval'] = 'false';
}
$setting['startSlide'] = $setting['startSlide'] ? $setting['startSlide'] : '0';
$setting['customercarousel'] = $cs;
$setting['id'] = rand() + count($cs);
$setting['random_number'] = rand(20, rand());
$output = array('type' => 'customercarousel', 'data' => $setting);
return $output;
}
示例4: cleanDocumentContent
public static function cleanDocumentContent(&$document)
{
if (isset($document['original_content'])) {
foreach ($document['original_content'] as &$text) {
$text['original_phrase'] = Tools::stripslashes(str_replace("\\r\\n", '<br />', $text['original_phrase']));
}
}
}
示例5: renderContent
public function renderContent($args, $setting)
{
$t = array('name' => '', 'html' => '');
$setting = array_merge($t, $setting);
$languageID = Context::getContext()->language->id;
$setting['html'] = isset($setting['htmlcontent_' . $languageID]) ? Tools::stripslashes($setting['htmlcontent_' . $languageID]) : '';
$output = array('type' => 'html', 'data' => $setting);
return $output;
}
示例6: renderContent
public function renderContent($args, $setting)
{
$t = array('name' => '', 'video_code' => '');
$setting = array_merge($t, $setting);
$html = $setting['video_code'];
$html = html_entity_decode(Tools::stripslashes($html), ENT_QUOTES, 'UTF-8');
$header = '';
$content = $html;
$output = array('type' => 'video', 'data' => $setting);
return $output;
}
示例7: renderContent
public function renderContent($args, $setting)
{
$header = '';
$content = '';
$ac = array();
$languageID = Context::getContext()->language->id;
for ($i = 1; $i <= 6; $i++) {
$header = isset($setting['header_' . $i . '_' . $languageID]) ? Tools::stripslashes($setting['header_' . $i . '_' . $languageID]) : '';
if (!empty($header)) {
$content = isset($setting['content_' . $i . '_' . $languageID]) ? Tools::stripslashes($setting['content_' . $i . '_' . $languageID]) : '';
$ac[] = array('header' => $header, 'content' => trim($content));
}
}
$setting['accordions'] = $ac;
$setting['id'] = rand() + count($ac);
$output = array('type' => 'accordion', 'data' => $setting);
return $output;
}
示例8: renderContent
public function renderContent($args, $setting)
{
$content = '';
$tabs = array();
$languageID = Context::getContext()->language->id;
for ($i = 1; $i <= $setting['nbtabhtml']; $i++) {
$title = isset($setting['title_' . $i . '_' . $languageID]) ? Tools::stripslashes($setting['title_' . $i . '_' . $languageID]) : '';
if (!empty($title)) {
$content = isset($setting['content_' . $i . '_' . $languageID]) ? Tools::stripslashes($setting['content_' . $i . '_' . $languageID]) : '';
$tabs[] = array('title' => trim($title), 'content' => trim($content));
}
}
$setting['tabhtmls'] = $tabs;
$setting['id'] = rand() + count($tabs);
$output = array('type' => 'tabhtml', 'data' => $setting);
//echo "<pre>";print_r($setting);die;
return $output;
}
示例9: send
public static function send()
{
$sql = 'SELECT `id_ebay_stat`, `tries`, `version`, `data`, `date_add`
FROM ' . _DB_PREFIX_ . 'ebay_stat';
$res = Db::getInstance()->executeS($sql);
foreach ($res as $row) {
$data = array('version' => $row['version'], 'data' => Tools::stripslashes($row['data']), 'date' => $row['date_add'], 'sig' => EbayStat::_computeSignature($row['version'], Tools::stripslashes($row['data']), $row['date_add']));
$opts = array('http' => array('method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($data)));
$context = stream_context_create($opts);
$ret = Tools::file_get_contents(self::$server . '/stats.php', false, $context);
if ($ret == 'OK' || $row['tries'] > 0) {
// if upload is OK or if it's the second try already
$sql = 'DELETE FROM `' . _DB_PREFIX_ . 'ebay_stat`
WHERE `id_ebay_stat` = ' . (int) $row['id_ebay_stat'];
} else {
$sql = 'UPDATE `' . _DB_PREFIX_ . 'ebay_stat`
SET `tries` = `tries` + 1
WHERE `id_ebay_stat` = ' . (int) $row['id_ebay_stat'];
}
Db::getInstance()->execute($sql);
}
}
示例10: smartsendMail
function smartsendMail($sname, $semailAddr, $scomment, $slink = null)
{
$name = Tools::stripslashes($sname);
$e_body = 'You have Received a New Comment In Your Blog Post From ' . $name . '. Comment: ' . $scomment . ' .Your Can reply Here : ' . $slink . '';
$emailAddr = Tools::stripslashes($semailAddr);
$comment = Tools::stripslashes($scomment);
$subject = 'New Comment Posted';
$id_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$to = Configuration::get('PS_SHOP_EMAIL');
$contactMessage = "\n \t\t\t\t{$comment} \n \t\t\t\tName: {$name}\n \t\t\t\tIP: " . (version_compare(_PS_VERSION_, '1.3.0.0', '<') ? $_SERVER['REMOTE_ADDR'] : Tools::getRemoteAddr());
if (Mail::Send($id_lang, 'contact', $subject, array('{message}' => nl2br($e_body), '{email}' => $emailAddr), $to, null, $emailAddr, $name)) {
return true;
}
}
示例11: getWidgetContent
/**
*
*/
public function getWidgetContent($type, $data)
{
// $method = 'renderWidget'.Tools::ucfirst($type).'Content';
$args = array();
$data = Tools::jsonDecode(call_user_func('base64' . '_decode', $data), true);
$data['widget_heading'] = isset($data['widget_title_' . $this->langID]) ? Tools::stripslashes($data['widget_title_' . $this->langID]) : '';
//echo $method;
if (isset($this->engines[$type])) {
$args = array();
return $this->engines[$type]->renderContent($args, $data);
}
return false;
}
示例12: ajaxDoWidgetform
public function ajaxDoWidgetform()
{
if (Tools::getValue('wtype')) {
$template = $this->createTemplate('widgetform.tpl');
$data = Tools::getValue('data') ? unserialize(trim(Tools::getValue('data'))) : array();
if (isset($data['widget'])) {
foreach ($data['widget'] as $key => $value) {
$data['widget'][$key] = Tools::stripslashes($this->mcrypt->decode(str_replace(' ', '+', $value)));
}
$data['widget']['wkey'] = Tools::getValue('wkey');
}
$widget_data = isset($data['widget']) ? $data['widget'] : array();
$form = $this->profile->renderForm(Tools::getValue('wtype'), array('params' => $widget_data));
$template->assign(array('showed' => 1, 'wkey' => Tools::getValue('wkey'), 'form' => $form));
return $template->fetch();
}
}
示例13: l
protected function l($string, $class = 'AdminTab', $addslashes = false, $htmlentities = false)
{
if (!empty($class)) {
$str = ErpIllicopresta::findTranslation('erpillicopresta', $string, 'AdminAdvancedOrder');
$str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str;
return str_replace('"', '"', $addslashes ? addslashes($str) : Tools::stripslashes($str));
}
}
示例14: ImageDelete
public static function ImageDelete()
{
$get_blog_image = SmartBlogPost::getBlogImage();
$get_cate_image = BlogCategory::getCatImage();
$category_types = BlogImageType::GetImageAllType('category');
$posts_types = BlogImageType::GetImageAllType('post');
$author_types = BlogImageType::GetImageAllType('author');
foreach ($category_types as $image_type) {
foreach ($get_cate_image as $cat_img) {
$dir = _PS_MODULE_DIR_ . 'smartblog/images/category/' . $cat_img['id_smart_blog_category'] . '-' . Tools::stripslashes($image_type['type_name']) . '.jpg';
if (file_exists($dir)) {
unlink($dir);
}
}
}
foreach ($posts_types as $image_type) {
foreach ($get_blog_image as $blog_img) {
$dir = _PS_MODULE_DIR_ . 'smartblog/images/' . $blog_img['id_smart_blog_post'] . '-' . Tools::stripslashes($image_type['type_name']) . '.jpg';
if (file_exists($dir)) {
unlink($dir);
}
}
}
foreach ($author_types as $image_type) {
$dir = _PS_MODULE_DIR_ . 'smartblog/images/avatar/avatar-' . Tools::stripslashes($image_type['type_name']) . '.jpg';
if (file_exists($dir)) {
unlink($dir);
}
}
}
示例15: intval
jquery/jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="../js/admin.js"></script>
<script type="text/javascript" src="../js/toggle.js"></script>
<script type="text/javascript" src="../js/tools.js"></script>
<script type="text/javascript" src="../js/ajax.js"></script>
<link rel="shortcut icon" href="../img/favicon.ico" />
</head>
<body>
<div id="container">
<div style="float: left; margin-top: 11px;">
<form action="index.php?tab=AdminSearch&token=<?php
echo Tools::getAdminToken('AdminSearch' . intval(Tab::getIdFromClassName('AdminSearch')) . intval($cookie->id_employee));
?>
" method="post">
<input type="text" name="bo_query" id="bo_query" style="width: 120px;" value="<?php
echo isset($_POST['bo_query']) ? Tools::safeOutput(Tools::stripslashes($_POST['bo_query'])) : '';
?>
" /> <?php
translate('in');
?>
<select name="bo_search_type" id="bo_search_type" onchange="queryType();" style="font-size: 1em;">
<option value="1"<?php
echo (isset($_POST['bo_search_type']) and $_POST['bo_search_type'] == 1) ? ' selected="selected"' : '';
?>
><?php
echo translate('catalog');
?>
</option>
<option value="2"<?php
echo (isset($_POST['bo_search_type']) and $_POST['bo_search_type'] == 2) ? ' selected="selected"' : '';
?>