本文整理匯總了PHP中PHPWS_Text::parseInput方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPWS_Text::parseInput方法的具體用法?PHP PHPWS_Text::parseInput怎麽用?PHP PHPWS_Text::parseInput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PHPWS_Text
的用法示例。
在下文中一共展示了PHPWS_Text::parseInput方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processForm
public function processForm(array $values)
{
$this->setName(PHPWS_Text::parseInput($values['name']));
if (isset($values['active'])) {
$this->setActive();
} else {
$this->setInactive();
}
if (isset($values['disable_if_logged'])) {
$this->setDisableIfLogged(true);
} else {
$this->setDisableIfLogged(false);
}
}
示例2: setComment
function setComment($comment)
{
$this->comment = PHPWS_Text::parseInput($comment);
}
示例3: postSettings
function postSettings()
{
isset($_POST['enable']) ? PHPWS_Settings::set('whatsnew', 'enable', 1) : PHPWS_Settings::set('whatsnew', 'enable', 0);
isset($_POST['homeonly']) ? PHPWS_Settings::set('whatsnew', 'homeonly', 1) : PHPWS_Settings::set('whatsnew', 'homeonly', 0);
if (!empty($_POST['title'])) {
PHPWS_Settings::set('whatsnew', 'title', strip_tags(PHPWS_Text::parseInput($_POST['title'])));
} else {
PHPWS_Settings::reset('whatsnew', 'title');
}
if (!empty($_POST['text'])) {
PHPWS_Settings::set('whatsnew', 'text', PHPWS_Text::parseInput($_POST['text']));
} else {
PHPWS_Settings::set('whatsnew', 'text', null);
}
$cache_timeout = (int) $_POST['cache_timeout'];
if ((int) $cache_timeout <= 7200) {
PHPWS_Settings::set('whatsnew', 'cache_timeout', $cache_timeout);
} else {
PHPWS_Settings::reset('whatsnew', 'cache_timeout');
}
$qty_items = (int) $_POST['qty_items'];
if ((int) $qty_items <= 50) {
PHPWS_Settings::set('whatsnew', 'qty_items', $qty_items);
} else {
PHPWS_Settings::reset('whatsnew', 'qty_items');
}
isset($_POST['show_summaries']) ? PHPWS_Settings::set('whatsnew', 'show_summaries', 1) : PHPWS_Settings::set('whatsnew', 'show_summaries', 0);
isset($_POST['show_dates']) ? PHPWS_Settings::set('whatsnew', 'show_dates', 1) : PHPWS_Settings::set('whatsnew', 'show_dates', 0);
isset($_POST['show_source_modules']) ? PHPWS_Settings::set('whatsnew', 'show_source_modules', 1) : PHPWS_Settings::set('whatsnew', 'show_source_modules', 0);
if (isset($_POST['exclude'])) {
PHPWS_Settings::set('whatsnew', 'exclude', $_POST['exclude']);
}
if (isset($errors)) {
$this->message = implode('<br />', $errors);
return false;
} else {
PHPWS_Cache::remove('whatsnew_cache_key');
if (PHPWS_Settings::save('whatsnew')) {
return true;
} else {
return false;
}
}
}
示例4: setSummary
public function setSummary($summary)
{
if (PHPWS_Text::breakPost('summary')) {
$summary = PHPWS_Text::breaker($summary);
}
$this->summary = PHPWS_Text::parseInput($summary);
}
示例5: processForm
public function processForm(array $values)
{
parent::processForm($values);
$this->setPiwikUrl(PHPWS_Text::parseInput($values['piwik_url']));
$this->setPiwikId(PHPWS_Text::parseInput($values['piwik_id']));
}
示例6: postBlog
public function postBlog()
{
$event = $this->calendar->schedule->loadEvent();
if (!PHPWS_Core::initModClass('blog', 'Blog.php')) {
return;
}
$blog = new Blog();
$blog->title = $event->summary;
$tpl = $event->tplFormatTime();
$summary[] = sprintf('%s %s %s', $tpl['START_TIME'], $tpl['TO'], $tpl['END_TIME']);
if (!empty($event->location)) {
$summary[] = $event->getLocation();
}
$blog->summary = PHPWS_Text::parseInput('<p class="calendar-post">' . implode('<br />', $summary) . '</p>') . $event->description;
$blog->approved = 1;
$days = (int) $_POST['advance_post'];
$publish = $event->start_time - $days * 86400;
if ($publish < time()) {
$blog->publish_date = time();
} else {
$blog->publish_date =& $publish;
}
return !PHPWS_Error::logIfError($blog->save());
}
示例7: setContent
public function setContent($content)
{
$this->content = PHPWS_Text::parseInput($content);
}
示例8: save
/**
* Save this PHAT_Textarea
*
* @return mixed Message on success and PHPWS_Error on failure
* @access public
*/
function save()
{
$error = FALSE;
$result = $this->setValue($_REQUEST['PHAT_ElementValue']);
if (PHPWS_Error::isError($result)) {
$currentError = $result;
$error = TRUE;
}
$label = $this->getLabel();
if (!$_SESSION['PHAT_FormManager']->form->checkLabel($_REQUEST['PHAT_ElementName']) && strcasecmp($label, $_REQUEST['PHAT_ElementName']) != 0 || PHPWS_Error::isError($this->setLabel(PHPWS_DB::sqlFriendlyName($_REQUEST['PHAT_ElementName'])))) {
$currentError = PHPWS_Error::get(PHATFORM_INVALID_NAME, 'phatform', 'PHAT_Textarea::save()');
$error = TRUE;
}
$result = $this->setBlurb($_REQUEST['PHAT_ElementBlurb']);
if (PHPWS_Error::isError($result)) {
$currentError = $result;
$error = TRUE;
}
if (isset($_REQUEST['PHAT_ElementRequired'])) {
$this->setRequired(TRUE);
} else {
$this->setRequired(FALSE);
}
$rows = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementRows']);
if ($rows) {
$this->_rows = $rows;
} else {
$this->_rows = PHAT_DEFAULT_ROWS;
}
$cols = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementCols']);
if ($cols) {
$this->_cols = $cols;
} else {
$this->_cols = PHAT_DEFAULT_COLS;
}
if ($error) {
return $currentError;
} else {
if (PHPWS_Error::isError($this->commit())) {
return PHPWS_Error::get(PHATFORM_ELEMENT_FAIL, 'phatform', 'PHAT_Textarea::save()', array(dgettext('phatform', 'Textarea')));
} else {
return sprintf(dgettext('phatform', 'The %s element was saved successfully.'), dgettext('phatform', 'Textarea'));
}
}
}
示例9: processForm
public function processForm(array $values)
{
parent::processForm($values);
$this->setOwaUrl(PHPWS_Text::parseInput($values['owa_url']));
$this->setOwaSiteId(PHPWS_Text::parseInput($values['owa_site_id']));
if (isset($values['owa_track_page_view'])) {
$this->setTrackPageView(true);
} else {
$this->setTrackPageView(false);
}
if (isset($values['owa_track_clicks'])) {
$this->setTrackClicks(true);
} else {
$this->setTrackClicks(false);
}
if (isset($values['owa_track_domstream'])) {
$this->setTrackDomStream(true);
} else {
$this->setTrackDomStream(false);
}
}
示例10: action
function action()
{
//here we switch the actions
require_once PHPWS_SOURCE_DIR . "mod/xwysiwyg/class/xw_cms.php";
$this->content = "";
$action = PHPWS_Text::parseInput($_GET["action"]);
$this->linkRef = "./index.php?module=xwysiwyg";
//i use this above, to shorten links...
switch ($action) {
case "toggle":
if (isset($_GET['editor'])) {
PHPWS_xw_cms::toggleEditor_man(PHPWS_Text::parseInput($_GET["editor"]));
}
case "admin":
//this for action=admin
$settings = PHPWS_xwysiwyg::readConfig();
if (!is_array($settings)) {
$this->content .= $settings;
PHPWS_xw_cms::manageEditors();
break;
}
PHPWS_xw_cms::showOptions_man($settings);
break;
case "testEditor":
if (isset($_GET['xw_testarea'])) {
PHPWS_xw_cms::testEditors(PHPWS_Text::parseInput($_GET['xw_testarea']));
} else {
$text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
PHPWS_xw_cms::testEditors($text);
}
break;
case "manageEditor":
PHPWS_xw_cms::manageEditors();
break;
case "addEditor":
PHPWS_xw_cms::addEditor();
PHPWS_xw_cms::manageEditors();
break;
case "delEditor":
PHPWS_xw_cms::delEditor();
PHPWS_xw_cms::manageEditors();
break;
case "cpyEditor":
PHPWS_xw_cms::cpyEditor();
PHPWS_xw_cms::manageEditors();
break;
case "tarEditor":
PHPWS_xw_cms::tarEditor();
PHPWS_xw_cms::manageEditors();
break;
case "delFile":
PHPWS_xw_cms::delFile();
PHPWS_xw_cms::manageEditors();
break;
case "addArea":
$this->addArea();
break;
case "delArea":
if (isset($_GET['area'])) {
$this->delArea(PHPWS_Text::parseInput($_GET["area"]));
}
break;
default:
$this->content .= $_SESSION['translate']->it("no action given...");
break;
}
// send content to layout-module and forget the rest...
$GLOBALS["CNT_xwysiwyg"]["title"] = $_SESSION['translate']->it("xwysiwyg Manager");
$GLOBALS["CNT_xwysiwyg"]["content"] = $this->content;
}
示例11: processForm
public function processForm(array $values)
{
parent::processForm($values);
$this->setAccount(PHPWS_Text::parseInput($values['account']));
}
示例12: _editOptions
function _editOptions()
{
if (Current_User::allow('phatform', 'edit_options')) {
if (isset($_REQUEST['PHAT_OptionSetId']) && !is_numeric($_REQUEST['PHAT_OptionSetId']) || isset($_REQUEST['PHAT_OptionBack'])) {
$_REQUEST['PHAT_MAN_OP'] = 'Options';
$this->action();
return;
} else {
$optionSetId = $_REQUEST['PHAT_OptionSetId'];
}
if (isset($_REQUEST['PHAT_SaveOptionSet'])) {
if (is_array($_REQUEST['PHAT_ElementOptions']) && is_array($_REQUEST['PHAT_ElementValues'])) {
for ($i = 0; $i < sizeof($_REQUEST['PHAT_ElementOptions']); $i++) {
$_REQUEST['PHAT_ElementOptions'][$i] = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementOptions'][$i]);
$_REQUEST['PHAT_ElementValues'][$i] = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementValues'][$i]);
}
$options = addslashes(serialize($_REQUEST['PHAT_ElementOptions']));
$values = addslashes(serialize($_REQUEST['PHAT_ElementValues']));
$saveArray = array('optionSet' => $options, 'valueSet' => $values);
$db = new PHPWS_DB('mod_phatform_options');
$db->addWhere('id', $optionSetId);
$db->addValue($saveArray);
$db->update();
}
} else {
if (isset($_REQUEST['PHAT_delete'])) {
$db = new PHPWS_DB('mod_phatform_options');
$db->addWhere('id', $optionSetId);
$db->delete();
$_REQUEST['PHAT_MAN_OP'] = 'Options';
$this->action();
return;
}
}
$GLOBALS['CNT_phatform']['title'] = PHAT_TITLE;
$sql = "SELECT * FROM mod_phatform_options WHERE id='{$optionSetId}'";
$result = PHPWS_DB::getRow($sql);
if ($result) {
$elements = array();
$elements[] = PHPWS_Form::formHidden('module', $this->_module);
$elements[] = PHPWS_Form::formHidden('PHAT_MAN_OP', 'editOptions');
$elements[] = PHPWS_Form::formHidden('PHAT_OptionSetId', $optionSetId);
$options = unserialize(stripslashes($result['optionSet']));
$values = unserialize(stripslashes($result['valueSet']));
$editTags = array();
$editTags['TITLE'] = dgettext('phatform', 'Edit option set') . " {$result['label']}";
$editTags['NUMBER_LABEL'] = dgettext('phatform', 'Option');
$editTags['INPUT_LABEL'] = dgettext('phatform', 'Text');
$editTags['VALUE_LABEL'] = dgettext('phatform', 'Value');
$editTags['OPTIONS'] = '';
$rowClass = NULL;
for ($i = 0; $i < sizeof($options); $i++) {
$optionRow['OPTION_NUMBER'] = $i + 1;
$optionRow['OPTION_INPUT'] = PHPWS_Form::formTextField("PHAT_ElementOptions[{$i}]", $options[$i], PHAT_DEFAULT_SIZE, PHAT_DEFAULT_MAXSIZE);
$optionRow['VALUE_INPUT'] = PHPWS_Form::formTextField("PHAT_ElementValues[{$i}]", $values[$i], PHAT_DEFAULT_SIZE, PHAT_DEFAULT_MAXSIZE);
$optionRow['ROW_CLASS'] = $rowClass;
if ($i % 2) {
$rowClass = ' class="bgcolor1"';
} else {
$rowClass = null;
}
$editTags['OPTIONS'] .= PHPWS_Template::processTemplate($optionRow, 'phatform', 'options/option.tpl');
}
}
$editTags['BACK_BUTTON'] = PHPWS_Form::formSubmit(dgettext('phatform', 'Back'), 'PHAT_OptionBack');
$editTags['SAVE_BUTTON'] = PHPWS_Form::formSubmit(dgettext('phatform', 'Save'), 'PHAT_SaveOptionSet');
$elements[] = PHPWS_Template::processTemplate($editTags, 'phatform', 'options/optionList.tpl');
return PHPWS_Form::makeForm('PHAT_Options_edit', 'index.php', $elements);
} else {
$this->_list();
}
}
示例13: setDescription
public function setDescription($description, $suggested = false)
{
if ($suggested) {
$description = strip_tags($description);
}
$this->description = PHPWS_Text::parseInput($description);
}
示例14: save
/**
* Save new settings
*
* @author Greg Meiste <greg.meiste+github@gmail.com>
*/
function save()
{
PHPWS_Settings::set('wiki', 'show_on_home', (int) isset($_POST['show_on_home']));
PHPWS_Settings::set('wiki', 'allow_anon_view', (int) isset($_POST['allow_anon_view']));
PHPWS_Settings::set('wiki', 'allow_page_edit', (int) isset($_POST['allow_page_edit']));
PHPWS_Settings::set('wiki', 'allow_image_upload', (int) isset($_POST['allow_image_upload']));
PHPWS_Settings::set('wiki', 'allow_bbcode', (int) isset($_POST['allow_bbcode']));
PHPWS_Settings::set('wiki', 'ext_chars_support', (int) isset($_POST['ext_chars_support']));
PHPWS_Settings::set('wiki', 'add_to_title', (int) isset($_POST['add_to_title']));
PHPWS_Settings::set('wiki', 'format_title', (int) isset($_POST['format_title']));
PHPWS_Settings::set('wiki', 'show_modified_info', (int) isset($_POST['show_modified_info']));
PHPWS_Settings::set('wiki', 'monitor_edits', (int) isset($_POST['monitor_edits']));
if (isset($_POST['diff_type'])) {
PHPWS_Settings::set('wiki', 'diff_type', 'one_col');
} else {
PHPWS_Settings::set('wiki', 'diff_type', 'two_col');
}
PHPWS_Core::initCoreClass('Mail.php');
if (isset($_POST['admin_email']) && PHPWS_Mail::checkAddress($_POST['admin_email'])) {
PHPWS_Settings::set('wiki', 'admin_email', PHPWS_Text::parseInput($_POST['admin_email']));
}
if (isset($_POST['email_text'])) {
PHPWS_Settings::set('wiki', 'email_text', PHPWS_Text::parseInput($_POST['email_text']));
}
if (isset($_POST['default_page']) && strlen($_POST['default_page']) > 0) {
PHPWS_Settings::set('wiki', 'default_page', PHPWS_Text::parseInput($_POST['default_page']));
}
if (isset($_POST['ext_page_target'])) {
PHPWS_Settings::set('wiki', 'ext_page_target', PHPWS_Text::parseInput($_POST['ext_page_target']));
}
PHPWS_Settings::set('wiki', 'immutable_page', (int) isset($_POST['immutable_page']));
PHPWS_Settings::set('wiki', 'raw_text', (int) isset($_POST['raw_text']));
PHPWS_Settings::set('wiki', 'print_view', (int) isset($_POST['print_view']));
PHPWS_Settings::set('wiki', 'what_links_here', (int) isset($_POST['what_links_here']));
PHPWS_Settings::set('wiki', 'recent_changes', (int) isset($_POST['recent_changes']));
PHPWS_Settings::set('wiki', 'random_page', (int) isset($_POST['random_page']));
PHPWS_Settings::set('wiki', 'discussion', (int) isset($_POST['discussion']));
if (isset($_POST['discussion_anon'])) {
PHPWS_Settings::set('wiki', 'discussion', 1);
PHPWS_Settings::set('wiki', 'discussion_anon', 1);
} else {
PHPWS_Settings::set('wiki', 'discussion_anon', 0);
}
if (PHPWS_Error::logIfError(PHPWS_Settings::save('wiki'))) {
return dgettext('wiki', 'There was an error saving the settings.');
}
return dgettext('wiki', 'Your settings have been successfully saved.');
}
示例15: postHeader
public function postHeader()
{
PHPWS_Core::initModClass('pagesmith', 'PS_Text.php');
$header = strip_tags($_POST['header'], PS_ALLOWED_HEADER_TAGS);
$section = new PS_Text();
$section->pid = $_POST['pid'];
$section->secname = $_POST['section_name'];
$section->content = PHPWS_Text::parseInput($header);
$section->setSaved();
$vars['cnt_section_name'] = $_POST['tpl'] . '-' . $_POST['section_name'];
//$vars['hdn_section_name'] = sprintf('pagesmith_%s', $_POST['section_name']);
$vars['content'] = addslashes(PHPWS_Text::parseOutput($section->content));
$vars['hidden_value'] = $section->content;
Layout::nakedDisplay(javascriptMod('pagesmith', 'update', $vars));
}