本文整理汇总了PHP中Misc::activateLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::activateLinks方法的具体用法?PHP Misc::activateLinks怎么用?PHP Misc::activateLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Misc
的用法示例。
在下文中一共展示了Misc::activateLinks方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDetails
/**
* Method used to get the details of a FAQ entry for a given FAQ ID.
*
* @access public
* @param integer $faq_id The FAQ entry ID
* @return array The FAQ entry details
*/
function getDetails($faq_id)
{
$stmt = "SELECT\n *\n FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "faq\n WHERE\n faq_id=" . Misc::escapeInteger($faq_id);
$res = $GLOBALS["db_api"]->dbh->getRow($stmt, DB_FETCHMODE_ASSOC);
if (PEAR::isError($res)) {
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
return "";
} else {
if (Customer::doesBackendUseSupportLevels($res['faq_prj_id'])) {
// get all of the support level associations here as well
$res['support_levels'] = array_keys(FAQ::getAssociatedSupportLevels($res['faq_prj_id'], $res['faq_id']));
}
if (empty($res['faq_updated_date'])) {
$res['faq_updated_date'] = $res['faq_created_date'];
}
$res['faq_updated_date'] = Date_API::getFormattedDate($res['faq_updated_date']);
$res['message'] = Misc::activateLinks(nl2br(htmlspecialchars($res['faq_message'])));
return $res;
}
}
示例2: getDetails
/**
* Method used to get the details of a FAQ entry for a given FAQ ID.
*
* @param integer $faq_id The FAQ entry ID
* @return array The FAQ entry details
*/
public static function getDetails($faq_id)
{
$stmt = 'SELECT
*
FROM
{{%faq}}
WHERE
faq_id=?';
try {
$res = DB_Helper::getInstance()->getRow($stmt, array($faq_id));
} catch (DbException $e) {
return '';
}
if ($res == null) {
return '';
}
$res['support_levels'] = array_keys(self::getAssociatedSupportLevels($res['faq_prj_id'], $res['faq_id']));
if (empty($res['faq_updated_date'])) {
$res['faq_updated_date'] = $res['faq_created_date'];
}
$res['message'] = Misc::activateLinks(nl2br(htmlspecialchars($res['faq_message'])));
return $res;
}
示例3: getListing
/**
* Method used to get the full listing of phone support entries
* associated with a specific issue.
*
* @param integer $issue_id The issue ID
* @return array The list of notes
*/
public static function getListing($issue_id)
{
$stmt = 'SELECT
{{%phone_support}}.*,
usr_full_name,
phc_title,
iss_prj_id
FROM
{{%phone_support}},
{{%project_phone_category}},
{{%user}},
{{%issue}}
WHERE
phs_iss_id=iss_id AND
iss_prj_id=phc_prj_id AND
phs_phc_id=phc_id AND
phs_usr_id=usr_id AND
phs_iss_id=?
ORDER BY
phs_created_date ASC';
try {
$res = DB_Helper::getInstance()->getAll($stmt, array($issue_id));
} catch (DbException $e) {
return '';
}
foreach ($res as &$row) {
$row['phs_description'] = Misc::activateLinks(nl2br(htmlspecialchars($row['phs_description'])));
$row['phs_description'] = Link_Filter::processText($row['iss_prj_id'], $row['phs_description']);
$row['phs_created_date'] = Date_Helper::getFormattedDate($row['phs_created_date']);
}
return $res;
}
示例4: processText
/**
* Processes text through all link filters.
*
* @param integer $prj_id The ID of the project
* @param string $text The text to process
* @param string $class The CSS class to use on the actual links
* @return string The processed text.
*/
public static function processText($prj_id, $text, $class = 'link')
{
// process issue link seperatly since it has to do something special
$text = Misc::activateLinks($text, $class);
$filters = array_merge(self::getFilters(), self::getFiltersByProject($prj_id), Workflow::getLinkFilters($prj_id));
foreach ((array) $filters as $filter) {
list($pattern, $replacement) = $filter;
// replacement may be a callback, provided by workflow
if (is_callable($replacement)) {
$text = preg_replace_callback($pattern, $replacement, $text);
} else {
$text = preg_replace($pattern, $replacement, $text);
}
}
return $text;
}
示例5: processText
/**
* Processes text through all link filters.
*
* @access public
* @param integer $prj_id The ID of the project
* @param string $text The text to process
* @param string $class The CSS class to use on the actual links
* @return string The processed text.
*/
function processText($prj_id, $text, $class = "link")
{
// process issue link seperatly since it has to do something special
$text = Misc::activateLinks($text, $class);
$text = Link_Filter::processIssueSpecificLinks($text);
$filters = Link_Filter::getFilters($prj_id);
if (count($filters) > 0) {
foreach ($filters as $filter) {
$text = preg_replace('/' . $filter[0] . '/i', $filter[1], $text);
}
}
return $text;
}
示例6: getListing
/**
* Method used to get the full listing of phone support entries
* associated with a specific issue.
*
* @access public
* @param integer $issue_id The issue ID
* @return array The list of notes
*/
function getListing($issue_id)
{
$stmt = "SELECT\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "phone_support.*,\n usr_full_name,\n phc_title,\n iss_prj_id\n FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "phone_support,\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_phone_category,\n " . ETEL_USER_TABLE . ",\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n WHERE\n phs_iss_id=iss_id AND\n iss_prj_id=phc_prj_id AND\n phs_phc_id=phc_id AND\n phs_usr_id=usr_id AND\n phs_iss_id=" . Misc::escapeInteger($issue_id) . "\n ORDER BY\n phs_created_date ASC";
$res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC);
if (PEAR::isError($res)) {
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
return "";
} else {
for ($i = 0; $i < count($res); $i++) {
$res[$i]["phs_description"] = Misc::activateLinks(nl2br(htmlspecialchars($res[$i]["phs_description"])));
$res[$i]["phs_description"] = Link_Filter::processText($res[$i]['iss_prj_id'], $res[$i]["phs_description"]);
$res[$i]["phs_created_date"] = Date_API::getFormattedDate($res[$i]["phs_created_date"]);
}
return $res;
}
}