本文整理汇总了PHP中Vtiger_Functions::removeHtmlTags方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions::removeHtmlTags方法的具体用法?PHP Vtiger_Functions::removeHtmlTags怎么用?PHP Vtiger_Functions::removeHtmlTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Functions
的用法示例。
在下文中一共展示了Vtiger_Functions::removeHtmlTags方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
function get($key)
{
$value = parent::get($key);
if ($key === 'content' && $_REQUEST['view'] == 'Detail') {
return Vtiger_Functions::removeHtmlTags(array('link', 'style', 'a', 'img', 'script'), decode_html($value));
}
if ($key === 'uid' || $key === 'content') {
return decode_html($value);
}
return $value;
}
示例2: showEmailsList
public function showEmailsList($srecord, $smodule, $Config, $type)
{
$return = [];
$adb = PearDatabase::getInstance();
$widgets = $this->modules_email_actions_widgets;
$queryParams = [];
if ($widgets[$smodule]) {
$ids = [];
$result = $adb->pquery('SELECT ossmailviewid FROM vtiger_ossmailview_relation WHERE crmid = ? AND `deleted` = ? ORDER BY `date` DESC LIMIT ' . $Config['widget_limit'], [$srecord, 0]);
while ($row = $adb->fetch_array($result)) {
$ids[] = $row['ossmailviewid'];
}
if (count($ids) == 0) {
return [];
}
$queryParams[] = $ids;
if ($type != 'all') {
$ifwhere = ' AND type = ?';
$queryParams[] = $type;
}
$query = 'SELECT vtiger_ossmailview.* FROM vtiger_ossmailview INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_ossmailview.ossmailviewid';
$query .= ' WHERE ossmailviewid IN (' . generateQuestionMarks($ids) . ')' . $ifwhere;
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleName = 'OSSMailView';
$instance = CRMEntity::getInstance($moduleName);
$securityParameter = $instance->getUserAccessConditionsQuerySR($moduleName, $currentUser);
if ($securityParameter != '') {
$query .= $securityParameter;
}
$query .= ' ORDER BY ossmailviewid DESC LIMIT ' . $Config['widget_limit'];
$result = $adb->pquery($query, $queryParams, true);
while ($row = $adb->fetch_array($result)) {
$from = $this->findRecordsById($row['from_id']);
$to = $this->findRecordsById($row['to_id']);
$return[$row['ossmailviewid']]['id'] = $row['ossmailviewid'];
$return[$row['ossmailviewid']]['date'] = $row['date'];
$return[$row['ossmailviewid']]['subject'] = '<a href="index.php?module=OSSMailView&view=preview&record=' . $row['ossmailviewid'] . '" target="' . $Config['target'] . '"> ' . $this->limit_text($row['subject']) . '</a>';
$return[$row['ossmailviewid']]['attachments'] = $row['attachments_exist'];
$return[$row['ossmailviewid']]['from'] = $from == '' && $from ? $from : $this->limit_text($row['from_email']);
$return[$row['ossmailviewid']]['to'] = $to == '' && $to ? $to : $this->limit_text($row['to_email']);
$return[$row['ossmailviewid']]['type'] = $row['type'];
$return[$row['ossmailviewid']]['body'] = Vtiger_Functions::removeHtmlTags(array('link', 'style', 'a', 'img', 'script', 'head', 'base'), decode_html($row['content']));
}
}
return $return;
}
示例3: showEmailsList
public function showEmailsList($srecord, $smodule, $config, $type, $filter = 'All')
{
$return = [];
$adb = PearDatabase::getInstance();
$widgets = $this->modules_email_actions_widgets;
$queryParams = [];
if ($widgets[$smodule]) {
$ids = [];
$relatedID = [];
if ($filter == 'All' || $filter == 'Contacts') {
$result = $adb->pquery('SELECT vtiger_contactdetails.contactid FROM vtiger_contactdetails ' . 'INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid ' . 'WHERE vtiger_contactdetails.parentid = ? AND vtiger_crmentity.deleted = ?', [$srecord, 0]);
while ($row = $adb->fetch_array($result)) {
$relatedID[] = $row['contactid'];
}
}
if ($filter != 'Contacts') {
$relatedID[] = $srecord;
}
$query = 'SELECT ossmailviewid FROM vtiger_ossmailview_relation WHERE crmid IN(' . implode(',', $relatedID) . ') AND `deleted` = ? ORDER BY `date` DESC';
if ($config['widget_limit'] != '') {
$query .= ' LIMIT ' . $config['widget_limit'];
}
$result = $adb->pquery($query, [0]);
while ($row = $adb->fetch_array($result)) {
$ids[] = $row['ossmailviewid'];
}
if (count($ids) == 0) {
return [];
}
$queryParams[] = $ids;
if ($type != 'All') {
$ifwhere = ' AND type = ?';
$queryParams[] = $type;
}
$query = 'SELECT vtiger_ossmailview.* FROM vtiger_ossmailview INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_ossmailview.ossmailviewid';
$query .= ' WHERE ossmailviewid IN (' . generateQuestionMarks($ids) . ')' . $ifwhere;
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleName = 'OSSMailView';
$instance = CRMEntity::getInstance($moduleName);
$securityParameter = $instance->getUserAccessConditionsQuerySR($moduleName, $currentUser);
if ($securityParameter != '') {
$query .= $securityParameter;
}
$query .= ' ORDER BY ossmailviewid DESC';
if ($config['widget_limit'] != '') {
$query .= ' LIMIT ' . $config['widget_limit'];
}
$result = $adb->pquery($query, $queryParams, true);
while ($row = $adb->fetch_array($result)) {
$from = $this->findRecordsById($row['from_id']);
$from = $from && $from != '' ? $from : $row['from_email'];
$to = $this->findRecordsById($row['to_id']);
$to = $to && $to != '' ? $to : $row['to_email'];
$content = Vtiger_Functions::removeHtmlTags(['link', 'style', 'a', 'img', 'script', 'base'], decode_html($row['content']));
$return[] = ['id' => $row['ossmailviewid'], 'date' => $row['date'], 'firstLetter' => strtoupper(Vtiger_Functions::textLength(trim(strip_tags($from)), 1, false)), 'subject' => '<a href="index.php?module=OSSMailView&view=preview&record=' . $row['ossmailviewid'] . '" target="' . $config['target'] . '"> ' . $row['subject'] . '</a>', 'attachments' => $row['attachments_exist'], 'from' => $from, 'to' => $to, 'url' => 'index.php?module=OSSMailView&view=preview&record=' . $row['ossmailviewid'], 'type' => $row['type'], 'teaser' => Vtiger_Functions::textLength(trim(preg_replace('/[ \\t]+/', ' ', strip_tags($content))), 100), 'body' => $content];
}
}
return $return;
}