本文整理匯總了PHP中Sintattica\Atk\Core\Tools::atk_html_entity_decode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tools::atk_html_entity_decode方法的具體用法?PHP Tools::atk_html_entity_decode怎麽用?PHP Tools::atk_html_entity_decode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sintattica\Atk\Core\Tools
的用法示例。
在下文中一共展示了Tools::atk_html_entity_decode方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handle
/**
* Handle the error.
*
* @param string $errorMessage
* @param string $debugMessage
*/
public function handle($errorMessage, $debugMessage)
{
$sessionManager = SessionManager::getInstance();
$sessionData =& SessionManager::getSession();
$txt_app_title = Tools::atktext('app_title');
if ($this->params['mailto'] != '') {
// only if enabled..
$atk = Atk::getInstance();
$subject = '[' . $_SERVER['SERVER_NAME'] . "] {$txt_app_title} error";
$defaultfrom = sprintf('%s <%s@%s>', $txt_app_title, Config::getGlobal('identifier', 'atk'), $_SERVER['SERVER_NAME']);
$from = Config::getGlobal('mail_sender', $defaultfrom);
$body = "Hello,\n\nAn error seems to have occurred in the atk application named '{$txt_app_title}'.\n";
$body .= "\nThe errormessage was:\n\n" . implode("\n", is_array($errorMessage) ? $errorMessage : array()) . "\n";
$body .= "\nA detailed report follows:\n";
$body .= "\nPHP Version: " . phpversion() . "\n\n";
$body .= "\nDEBUGMESSAGES\n" . str_repeat('-', 70) . "\n";
$lines = [];
for ($i = 0, $_ = count($debugMessage); $i < $_; ++$i) {
$lines[] = $this->_wordwrap(Tools::atk_html_entity_decode(preg_replace('(\\[<a.*</a>\\])', '', $debugMessage[$i])));
}
$body .= implode("\n", $lines);
if (is_array($_GET)) {
$body .= "\n\n_GET\n" . str_repeat('-', 70) . "\n";
foreach ($_GET as $key => $value) {
$body .= $this->_wordwrap($key . str_repeat(' ', max(1, 20 - strlen($key))) . ' = ' . var_export($value, 1)) . "\n";
}
}
if (function_exists('getallheaders')) {
$request = getallheaders();
if (count($request) > 0) {
$body .= "\n\nREQUEST INFORMATION\n" . str_repeat('-', 70) . "\n";
foreach ($request as $key => $value) {
$body .= $this->_wordwrap($key . str_repeat(' ', max(1, 30 - strlen($key))) . ' = ' . var_export($value, 1)) . "\n";
}
}
}
if (is_array($_POST)) {
$body .= "\n\n_POST\n" . str_repeat('-', 70) . "\n";
foreach ($_POST as $key => $value) {
$body .= $this->_wordwrap($key . str_repeat(' ', max(1, 20 - strlen($key))) . ' = ' . var_export($value, 1)) . "\n";
}
}
if (is_array($_COOKIE)) {
$body .= "\n\n_COOKIE\n" . str_repeat('-', 70) . "\n";
foreach ($_COOKIE as $key => $value) {
$body .= $this->_wordwrap($key . str_repeat(' ', max(1, 20 - strlen($key))) . ' = ' . var_export($value, 1)) . "\n";
}
}
$body .= "\n\nATK CONFIGURATION\n" . str_repeat('-', 70) . "\n";
foreach ($GLOBALS as $key => $value) {
if (substr($key, 0, 7) == 'config_') {
$body .= $this->_wordwrap($key . str_repeat(' ', max(1, 30 - strlen($key))) . ' = ' . var_export($value, 1)) . "\n";
}
}
$body .= "\n\nMODULE CONFIGURATION\n" . str_repeat('-', 70) . "\n";
foreach ($atk->g_modules as $modname => $modpath) {
$modexists = file_exists($modpath) ? ' (path exists)' : ' (PATH DOES NOT EXIST!)';
$body .= $this->_wordwrap($modname . ':' . str_repeat(' ', max(1, 20 - strlen($modname))) . var_export($modpath, 1) . $modexists) . "\n";
}
$body .= "\n\nCurrent User:\n" . str_repeat('-', 70) . "\n";
$user = SecurityManager::atkGetUser();
if (is_array($user) && count($user)) {
foreach ($user as $key => $value) {
$body .= $this->_wordwrap($key . str_repeat(' ', max(1, 30 - strlen($key))) . ' = ' . var_export($value, 1)) . "\n";
}
} else {
$body .= "Not known\n";
}
if (is_object($sessionManager)) {
$body .= "\n\nATK SESSION\n" . str_repeat('-', 70);
$body .= "\nNamespace: " . $sessionManager->getNameSpace() . "\n";
if (isset($sessionData[$sessionManager->getNameSpace()]['stack'])) {
$stack = $sessionData[$sessionManager->getNameSpace()]['stack'];
for ($i = 0; $i < count($stack); ++$i) {
$body .= "\nStack level {$i}:\n";
$item = isset($stack[$i]) ? $stack[$i] : null;
if (is_array($item)) {
foreach ($item as $key => $value) {
$body .= $this->_wordwrap($key . str_repeat(' ', max(1, 30 - strlen($key))) . ' = ' . var_export($value, 1)) . "\n";
}
}
}
}
if (isset($sessionData[$sessionManager->getNameSpace()]['globals'])) {
$ns_globals = $sessionData[$sessionManager->getNameSpace()]['globals'];
if (count($ns_globals) > 0) {
$body .= "\nNamespace globals:\n";
foreach ($ns_globals as $key => $value) {
$body .= $this->_wordwrap($key . str_repeat(' ', max(1, 30 - strlen($key))) . ' = ' . var_export($value, 1)) . "\n";
}
}
}
if (isset($sessionData['globals'])) {
$globals = $sessionData['globals'];
//.........這裏部分代碼省略.........
示例2: fillWorldCountriesArray
/**
* Fill the countries array with all the world countries.
*/
public function fillWorldCountriesArray()
{
$this->m_country['AF']['nl'] = 'Afghanistan';
$this->m_country['AF']['de'] = 'Afghanistan';
$this->m_country['AF']['en'] = 'Afghanistan';
$this->m_country['AL']['nl'] = Tools::atk_html_entity_decode('Albanië');
$this->m_country['AL']['de'] = 'Albania';
$this->m_country['AL']['en'] = 'Albania';
$this->m_country['DZ']['nl'] = 'Algerije';
$this->m_country['DZ']['de'] = 'Algeria';
$this->m_country['DZ']['en'] = 'Algeria';
$this->m_country['AS']['nl'] = 'Amerikaans-Samoa';
$this->m_country['AS']['de'] = 'American Samoa';
$this->m_country['AS']['en'] = 'American Samoa';
$this->m_country['AD']['nl'] = 'Andorra';
$this->m_country['AD']['de'] = 'Andorra';
$this->m_country['AD']['en'] = 'Andorra';
$this->m_country['AO']['nl'] = 'Angola';
$this->m_country['AO']['de'] = 'Angola';
$this->m_country['AO']['en'] = 'Angola';
$this->m_country['AI']['nl'] = 'Anguilla';
$this->m_country['AI']['de'] = 'Anguilla';
$this->m_country['AI']['en'] = 'Anguilla';
$this->m_country['AQ']['nl'] = 'Antarctica';
$this->m_country['AQ']['de'] = 'Antarctica';
$this->m_country['AQ']['en'] = 'Antarctica';
$this->m_country['AG']['nl'] = 'Antigua en Barbuda';
$this->m_country['AG']['de'] = 'Antigua and Barbuda';
$this->m_country['AG']['en'] = 'Antigua and Barbuda';
$this->m_country['AR']['nl'] = Tools::atk_html_entity_decode('Argentinië');
$this->m_country['AR']['de'] = 'Argentina';
$this->m_country['AR']['en'] = 'Argentina';
$this->m_country['AM']['nl'] = Tools::atk_html_entity_decode('Armenië');
$this->m_country['AM']['de'] = 'Armenia';
$this->m_country['AM']['en'] = 'Armenia';
$this->m_country['AW']['nl'] = 'Aruba';
$this->m_country['AW']['de'] = 'Aruba';
$this->m_country['AW']['en'] = 'Aruba';
$this->m_country['AU']['nl'] = Tools::atk_html_entity_decode('Australië');
$this->m_country['AU']['de'] = 'Australia';
$this->m_country['AU']['en'] = 'Australia';
$this->m_country['AT']['nl'] = 'Oosterijk';
$this->m_country['AT']['de'] = 'Austria';
$this->m_country['AT']['en'] = 'Austria';
$this->m_country['AZ']['nl'] = 'Azerbeidzjan';
$this->m_country['AZ']['de'] = 'Azerbaidjan';
$this->m_country['AZ']['en'] = 'Azerbaidjan';
$this->m_country['BS']['nl'] = 'Bahamas';
$this->m_country['BS']['de'] = 'Bahamas';
$this->m_country['BS']['en'] = 'Bahamas';
$this->m_country['BH']['nl'] = 'Bahrein';
$this->m_country['BH']['de'] = 'Bahrain';
$this->m_country['BH']['en'] = 'Bahrain';
$this->m_country['BD']['nl'] = 'Bangladesh';
$this->m_country['BD']['de'] = 'Bangladesh';
$this->m_country['BD']['en'] = 'Bangladesh';
$this->m_country['BB']['nl'] = 'Barbados';
$this->m_country['BB']['de'] = 'Barbados';
$this->m_country['BB']['en'] = 'Barbados';
$this->m_country['BY']['nl'] = 'Belarus';
$this->m_country['BY']['de'] = 'Belarus';
$this->m_country['BY']['en'] = 'Belarus';
$this->m_country['BE']['nl'] = Tools::atk_html_entity_decode('België');
$this->m_country['BE']['de'] = 'Belgien';
$this->m_country['BE']['en'] = 'Belgium';
$this->m_country['BZ']['nl'] = 'Belize';
$this->m_country['BZ']['de'] = 'Belize';
$this->m_country['BZ']['en'] = 'Belize';
$this->m_country['BJ']['nl'] = 'Benin';
$this->m_country['BJ']['de'] = 'Benin';
$this->m_country['BJ']['en'] = 'Benin';
$this->m_country['BM']['nl'] = 'Bermuda';
$this->m_country['BM']['de'] = 'Bermuda';
$this->m_country['BM']['en'] = 'Bermuda';
$this->m_country['BO']['nl'] = 'Bolivia';
$this->m_country['BO']['de'] = 'Bolivia';
$this->m_country['BO']['en'] = 'Bolivia';
$this->m_country['BA']['nl'] = Tools::atk_html_entity_decode('Bosnië-Herzegovina');
$this->m_country['BA']['de'] = 'Bosnia-Herzegovina';
$this->m_country['BA']['en'] = 'Bosnia-Herzegovina';
$this->m_country['BW']['nl'] = 'Botswana';
$this->m_country['BW']['de'] = 'Botswana';
$this->m_country['BW']['en'] = 'Botswana';
$this->m_country['BV']['nl'] = 'Bouvet';
$this->m_country['BV']['de'] = 'Bouvet Island';
$this->m_country['BV']['en'] = 'Bouvet Island';
$this->m_country['BR']['nl'] = Tools::atk_html_entity_decode('Brazilië');
$this->m_country['BR']['de'] = 'Brazil';
$this->m_country['BR']['en'] = 'Brazil';
$this->m_country['IO']['nl'] = 'Brits Territorium in de Indische Oceaan';
$this->m_country['IO']['de'] = 'British Indian O. Terr.';
$this->m_country['IO']['en'] = 'British Indian O. Terr.';
$this->m_country['BN']['nl'] = 'Brunei';
$this->m_country['BN']['de'] = 'Brunei Darussalam';
$this->m_country['BN']['en'] = 'Brunei Darussalam';
$this->m_country['BG']['nl'] = 'Bulgarije';
$this->m_country['BG']['de'] = 'Bulgaria';
//.........這裏部分代碼省略.........
示例3: render
/**
* Creates a special Recordlist that can be used for exporting to files or to make it printable.
*
* @param Node $node The node to use as definition for the columns.
* @param array $recordset The records to render
* @param string $sol String to use at start of each row
* @param string $sof String to use at start of each field
* @param string $eof String to use at end of each field
* @param string $eol String to use at end of each row
* @param int $type 0=Render rows in simple html tabl; 1= raw export
* @param string $compression Compression technique (bzip / gzip)
* @param array $suppressList List of attributes from $node that should be ignored
* @param array $outputparams Key-Value parameters for output. Currently existing:
* filename - the name of the file (without extension .csv)
* @param string $mode The mode that is passed to attributes' display() method
* (for overrides). Defaults to 'list'.
* @param bool $titlerow Should titlerow be rendered or not
* @param bool $decode Should data be decoded or not (for exports)
* @param string $fsep String to use between fields
* @param string $rfeplace String for replacing line feeds in recordset field values (null = do not replace)
*
* @return string|null
*/
public function render($node, $recordset, $sol, $sof, $eof, $eol, $type = 0, $compression = '', $suppressList = '', $outputparams = [], $mode = 'list', $titlerow = true, $decode = false, $fsep = '', $rfeplace = null)
{
$this->setNode($node);
$this->m_mode = $mode;
// example html csv
// $sol = '<tr>' or ''
// $sof = '<td>' or '"'
// $eof = '</td>' or '"'
// $eol = '</tr>' or '\r\n'
// $fsep = '' or ';'
//$empty om lege tabelvelden op te vullen;
// stuff for the totals row..
$output = '';
$empty = '';
if ($type == '0') {
$empty = ' ';
}
if ($titlerow) {
$output .= $sol;
// display a headerrow with titles.
// Since we are looping the attriblist anyway, we also check if there
// are totalisable collumns.
foreach (array_keys($this->m_node->m_attribList) as $attribname) {
$p_attrib = $this->m_node->m_attribList[$attribname];
$musthide = is_array($suppressList) && count($suppressList) > 0 && in_array($attribname, $suppressList);
if (!$this->isHidden($p_attrib) && !$musthide) {
$output .= $sof . $this->eolreplace($p_attrib->label(), $rfeplace) . $eof . $fsep;
}
}
if ($fsep) {
// remove separator at the end of line
$output = substr($output, 0, -strlen($fsep));
}
$output .= $eol;
}
// Display the values
for ($i = 0, $_i = count($recordset); $i < $_i; ++$i) {
$output .= $sol;
foreach (array_keys($this->m_node->m_attribList) as $attribname) {
$p_attrib = $this->m_node->m_attribList[$attribname];
$musthide = is_array($suppressList) && count($suppressList) > 0 && in_array($attribname, $suppressList);
if (!$this->isHidden($p_attrib) && !$musthide) {
// An <attributename>_display function may be provided in a derived
// class to display an attribute.
$funcname = $p_attrib->m_name . '_display';
if (method_exists($this->m_node, $funcname)) {
$value = $this->eolreplace($this->m_node->{$funcname}($recordset[$i], $this->m_mode), $rfeplace);
} else {
// otherwise, the display function of the particular attribute
// is called.
$value = $this->eolreplace($p_attrib->display($recordset[$i], $this->m_mode), $rfeplace);
}
if (Tools::atkGetCharset() != '' && $decode) {
$value = Tools::atk_html_entity_decode(htmlentities($value, ENT_NOQUOTES), ENT_NOQUOTES);
}
$output .= $sof . ($value == '' ? $empty : $value) . $eof . $fsep;
}
}
if ($fsep) {
// remove separator at the end of line
$output = substr($output, 0, -strlen($fsep));
}
$output .= $eol;
}
// html requires table tags
if ($type == '0') {
$output = '<table border="1" cellspacing="0" cellpadding="2">' . $output . '</table>';
}
Tools::atkdebug(Tools::atk_html_entity_decode($output));
// To a File
if (!array_key_exists('filename', $outputparams)) {
$outputparams['filename'] = 'achievo';
}
if ($this->m_exportcsv) {
$ext = $type == '0' ? 'html' : 'csv';
$exporter = new FileExport();
$exporter->export($output, $outputparams['filename'], $ext, $ext, $compression);
//.........這裏部分代碼省略.........