本文整理匯總了PHP中IPSText::textToForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::textToForm方法的具體用法?PHP IPSText::textToForm怎麽用?PHP IPSText::textToForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSText
的用法示例。
在下文中一共展示了IPSText::textToForm方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fetchTemplateBitForEdit
/**
* Fetch template bit for editing
*
* @access public
* @param int Template ID
* @param int Template Set ID
* @return array ..of data
* <code>
* Exception Codes:
* NO_SUCH_TEMPLATE: Could not locate template id#
* </code>
*/
public function fetchTemplateBitForEdit($templateID, $setID)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$templateID = intval($templateID);
//-----------------------------------------
// Fetch template data
//-----------------------------------------
$template = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'skin_templates', 'where' => 'template_id=' . $templateID));
if (!$template['template_id']) {
throw new Exception('NO_SUCH_TEMPLATE');
}
//-----------------------------------------
// Get skin data
//-----------------------------------------
$skinSetData = $this->registry->output->allSkins[$setID];
//-----------------------------------------
// Update data
//-----------------------------------------
$template['_actualSetID'] = $template['template_set'];
$template['_belongsSetID'] = $setID;
$template['_template_content'] = $template['template_content'];
$template['_template_data'] = $template['template_data'];
$template['_isMaster'] = $template['template_master_key'] ? 1 : 0;
//-----------------------------------------
// Update content for editing
//-----------------------------------------
$template['template_content'] = IPSText::textToForm($template['template_content']);
//-----------------------------------------
// Update function data for editing
//-----------------------------------------
$template['template_data'] = IPSText::textToForm($template['template_data']);
//-----------------------------------------
// Return it
//-----------------------------------------
return $template;
}
示例2: formatMergeForEdit
/**
* Format Merge: Edit
*
* @access public
* @param string Content from DB
* @return string Content suitable for editing in a text area
*/
public function formatMergeForEdit($text)
{
/* Re-format mark-up for preview */
preg_match_all("#<ips:conflict id=\"([0-9]+?)\">(.+?)</ips:conflict>#s", $text, $matches);
if (is_array($matches[1]) and count($matches[1])) {
foreach ($matches[1] as $index => $m) {
/* Yeah, I like readable code */
$_all = $matches[0][$index];
$_id = $matches[1][$index];
$_content = $matches[2][$index];
if ($_id != null and $_content) {
/* Format old default block */
$_content = preg_replace("#(?:\n)?<ips:cblock type=\"original\">(?:\n)?(.+?)(?:\n)?</ips:cblock>#s", "~~~~~~~~~~ CUSTOM CONTENT\n\\1", $_content);
/* Format custom block */
$_content = preg_replace("#(?:\n)?<ips:cblock type=\"new\">(?:\n)?(.+?)(?:\n)?</ips:cblock>#s", "\n===================\n\\1\n^^^^^^^^^^ NEW DEFAULT\n", $_content);
$text = str_replace($_all, $_content, $text);
}
}
}
/* Encode */
$text = IPSText::textToForm($text);
/* Convert special place holders */
$text = str_replace('~~~~~~~~~~', '<<<<<<<<<<', $text);
$text = str_replace('^^^^^^^^^^', '>>>>>>>>>>', $text);
return $text;
}
示例3: _mediaTagForm
/**
* Show the mediatag add/edit form
*
* @param string [$type='add']
* @param array [Optional] array of errors
* @return @e void
*/
protected function _mediaTagForm($type = 'add', $errors = array())
{
/* Check form type */
if ($type == 'add') {
/* Data */
$data = array('mediatag_name' => $this->request['mediatag_name'], 'mediatag_match' => rtrim(str_replace('\', '\\', str_replace(''', "'", trim(IPSText::stripslashes($_POST['mediatag_match'])))), ','), 'mediatag_replace' => rtrim(str_replace('\', '\\', str_replace(''', "'", trim(IPSText::stripslashes($_POST['mediatag_replace'])))), ','));
} else {
/* Data */
$id = intval($this->request['id']);
$data = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'bbcode_mediatag', 'where' => "mediatag_id={$id}"));
/* Set Defaults */
$data['mediatag_name'] = !empty($this->request['mediatag_name']) ? $this->request['mediatag_name'] : $data['mediatag_name'];
$data['mediatag_match'] = !empty($this->request['mediatag_match']) ? IPSText::textToForm($this->request['mediatag_match']) : IPSText::textToForm($data['mediatag_match']);
$data['mediatag_replace'] = !empty($this->request['mediatag_replace']) ? IPSText::textToForm($this->request['mediatag_replace']) : IPSText::textToForm($data['mediatag_replace']);
}
/* Setup Form */
$this->registry->output->html .= $this->html->mediaTagForm($type, $data, $errors);
}
示例4: _processSettingEntry
/**
* Process an individual setting for display
*
* @param array Setting record
* @return @e void
*/
public function _processSettingEntry($r)
{
/* Init editor class */
if (!is_object($this->editor)) {
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite');
$this->editor = new $classToLoad();
}
/* Init vars */
$tempSkinUrl = $this->settings['skin_app_url'];
$this->settings['skin_app_url'] = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/applications/core/skin_cp/';
$form_element = "";
$form_type = 'normal';
$dropdown = array();
$start = "";
$revert_button = "";
$key = $r['conf_key'];
$value = $r['conf_value'] != "" ? $r['conf_value'] : $r['conf_default'];
$value = $value == "{blank}" ? '' : $value;
$show = 1;
//-----------------------------------------------
// Default?
//-----------------------------------------------
$css = "";
if ($r['conf_value'] != "" and $r['conf_value'] != $r['conf_default']) {
$revert_button = "<li class='i_revert'><a href='" . $this->settings['_base_url'] . "&app=core&{$this->form_code}&do=setting_revert&id={$r['conf_id']}&conf_group={$r['conf_group']}&search=" . $this->request['search'] . "' title='{$this->lang->words['s_revertback']}'>{$this->lang->words['revert']}</a></li>";
}
//-----------------------------------------------
// Evil eval
//-----------------------------------------------
if ($r['conf_evalphp']) {
$r['conf_evalphp'] = str_replace('\', '\\', $r['conf_evalphp']);
$show = 1;
eval($r['conf_evalphp']);
}
if (!$show && !IN_DEV) {
return '';
}
switch ($r['conf_type']) {
case 'input':
$form_element = $this->registry->output->formInput($key, str_replace("'", "'", $value));
break;
case 'textarea':
$form_element = $this->registry->output->formTextarea($key, str_replace("&#092;", "\", IPSText::textToForm($value)), 45);
break;
case 'editor':
//$this->editor->setIsHtml( true );
$this->editor->setContent($value);
$form_element = $this->editor->show($key, array('minimize' => 1));
$form_type = 'rte';
break;
case 'yes_no':
$form_element = $this->registry->output->formYesNo($key, $value);
break;
case 'name_autocomplete':
$form_element = $this->html->nameAutoCompleteField($key, $value);
break;
default:
if ($r['conf_extra']) {
if ($r['conf_extra'] == '#show_forums#') {
//-----------------------------------------
// Require the library
// (Not a building with books)
//-----------------------------------------
require_once IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php';
/*noLibHook*/
$classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . '/sources/classes/forums/admin_forum_functions.php', 'admin_forum_functions', 'forums');
$aff = new $classToLoad($this->registry);
$aff->forumsInit();
$dropdown = $aff->adForumsForumList(1);
} else {
if ($r['conf_extra'] == '#show_groups#') {
$this->DB->build(array('select' => '*', 'from' => 'groups', 'order' => 'g_title ASC'));
$this->DB->execute();
while ($row = $this->DB->fetch()) {
if ($row['g_access_cp']) {
$row['g_title'] .= ' ' . $this->lang->words['setting_staff_tag'] . ' ';
}
$dropdown[] = array($row['g_id'], $row['g_title']);
}
} else {
if ($r['conf_extra'] == '#show_applications#') {
foreach (ipsRegistry::$applications as $app) {
$dropdown[] = array($app['app_directory'], $app['app_title']);
}
} else {
if ($r['conf_extra'] == '#show_skins#') {
$dropdown = $this->registry->output->generateSkinDropdown();
} else {
foreach (explode("\n", $r['conf_extra']) as $l) {
list($k, $v) = explode("=", $l);
if ($k != "" and $v != "") {
$dropdown[] = array(trim($k), trim($v));
}
}
//.........這裏部分代碼省略.........