コード例 #1
0
ファイル: Tracker.php プロジェクト: HaldunA/phpwebsite
 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
0
ファイル: WikiPage.php プロジェクト: Jopperi/wiki
 function setComment($comment)
 {
     $this->comment = PHPWS_Text::parseInput($comment);
 }
コード例 #3
0
ファイル: Whatsnew.php プロジェクト: HaldunA/phpwebsite
 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
0
ファイル: Blog.php プロジェクト: HaldunA/phpwebsite
 public function setSummary($summary)
 {
     if (PHPWS_Text::breakPost('summary')) {
         $summary = PHPWS_Text::breaker($summary);
     }
     $this->summary = PHPWS_Text::parseInput($summary);
 }
コード例 #5
0
ファイル: PiwikTracker.php プロジェクト: HaldunA/phpwebsite
 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
0
ファイル: Admin.php プロジェクト: par-orillonsoft/phpwebsite
 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
0
ファイル: Block_Item.php プロジェクト: HaldunA/phpwebsite
 public function setContent($content)
 {
     $this->content = PHPWS_Text::parseInput($content);
 }
コード例 #8
0
ファイル: Textarea.php プロジェクト: HaldunA/phpwebsite
 /**
  * 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
0
 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
0
 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
0
 public function processForm(array $values)
 {
     parent::processForm($values);
     $this->setAccount(PHPWS_Text::parseInput($values['account']));
 }
コード例 #12
0
ファイル: FormManager.php プロジェクト: HaldunA/phpwebsite
 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') . "&#160;{$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
0
ファイル: Event.php プロジェクト: HaldunA/phpwebsite
 public function setDescription($description, $suggested = false)
 {
     if ($suggested) {
         $description = strip_tags($description);
     }
     $this->description = PHPWS_Text::parseInput($description);
 }
コード例 #14
0
ファイル: WikiSettings.php プロジェクト: Jopperi/wiki
 /**
  * Save new settings
  *
  * @author Greg Meiste <*****@*****.**>
  */
 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
0
 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));
 }
コード例 #16
0
ファイル: Report.php プロジェクト: HaldunA/phpwebsite
 /**
  *
  *
  *
  *
  */
 function listEntries()
 {
     if (isset($_REQUEST['PHAT_EntrySearch'])) {
         $this->_searchQuery = PHPWS_Text::parseInput($_REQUEST['PHAT_EntrySearch']);
         $this->_listFilter = $_REQUEST['PHAT_ListFilter'];
         $this->setEntries();
         $this->pageStart = 0;
         $this->pageSection = 1;
         $this->pageLimit = $_REQUEST['PDA_limit'];
     } elseif (isset($_REQUEST['PHAT_FullList'])) {
         $this->_searchQuery = NULL;
         $this->_listFilter = 1;
         $this->setEntries();
         $this->pageStart = 0;
         $this->pageSection = 1;
     } else {
         if (isset($_REQUEST['PDA_start'])) {
             $this->pageStart = $_REQUEST['PDA_start'];
         } else {
             $_REQUEST['PDA_start'] = $this->pageStart;
         }
         if (isset($_REQUEST['PDA_section'])) {
             $this->pageSection = $_REQUEST['PDA_section'];
         } else {
             $_REQUEST['PDA_section'] = $this->pageSection;
         }
         if (isset($_REQUEST['PDA_limit'])) {
             $this->pageLimit = $_REQUEST['PDA_limit'];
         } else {
             $_REQUEST['PDA_limit'] = $this->pageLimit;
         }
     }
     $listTags = array();
     $listTags['ID_LABEL'] = dgettext('phatform', 'ID');
     $listTags['USER_LABEL'] = dgettext('phatform', 'User');
     $listTags['UPDATED_LABEL'] = dgettext('phatform', 'Updated');
     $listTags['ACTION_LABEL'] = dgettext('phatform', 'Action');
     $highlight = ' class="bgcolor1"';
     if (sizeof($this->_entries) > 0) {
         $data = PHAT_Report::paginateDataArray($this->_entries, 'index.php?module=phatform&amp;PHAT_REPORT_OP=list', $this->pageLimit, TRUE, array('<b>[ ', ' ]</b>'), NULL, 10, TRUE);
     }
     $count = 1;
     if (isset($data) && is_array($data[0]) && sizeof($data[0]) > 0) {
         $listTags['LIST_ITEMS'] = NULL;
         foreach ($data[0] as $entry) {
             $highlight = null;
             $rowTags = array();
             $rowTags['HIGHLIGHT'] = $highlight;
             $rowTags['ID'] = $entry['id'];
             $rowTags['USER'] = $entry['user'];
             $rowTags['UPDATED'] = date(PHPWS_DATE_FORMAT . ' ' . PHPWS_TIME_FORMAT, $entry['updated']);
             $rowTags['VIEW'] = '<a href="index.php?module=phatform&amp;PHAT_REPORT_OP=view&amp;PHAT_ENTRY_ID=' . $entry['id'] . '">' . dgettext('phatform', 'View') . '</a>';
             if (!isset($this->archive)) {
                 $rowTags['EDIT'] = '<a href="index.php?module=phatform&amp;PHAT_REPORT_OP=edit&amp;PHAT_ENTRY_ID=' . $entry['id'] . '">' . dgettext('phatform', 'Edit') . '</a>';
                 $rowTags['DELETE'] = '<a href="index.php?module=phatform&amp;PHAT_REPORT_OP=confirmDelete&amp;PHAT_ENTRY_ID=' . $entry['id'] . '">' . dgettext('phatform', 'Delete') . '</a>';
             }
             if ($count % 2) {
                 $highlight = ' class="bgcolor1"';
             }
             $count++;
             $listTags['LIST_ITEMS'] .= PHPWS_Template::processTemplate($rowTags, 'phatform', 'report/row.tpl');
         }
         if (!isset($_REQUEST['lay_quiet'])) {
             if ($this->_totalEntries > $this->pageLimit) {
                 $listTags['NAVIGATION_LINKS'] = $data[1];
             }
             $listTags['SECTION_INFO'] = $data[2];
             $listTags['SECTION_INFO_LABEL'] = dgettext('phatform', 'Entries');
         }
     } else {
         $listTags['LIST_ITEMS'] = '<tr><td colspan="4" class="smalltext">' . dgettext('phatform', 'No entries were found matching your search query.') . '</td></tr>';
     }
     if (!isset($_REQUEST['lay_quiet'])) {
         $filterOptions = array(1 => dgettext('phatform', 'All'), 2 => dgettext('phatform', 'Incomplete'), 3 => dgettext('phatform', 'Complete'));
         $limitOptions = array(10 => 10, 20 => 20, 30 => 30, 40 => 40, 50 => 50);
         $elements[0] = PHPWS_Form::formHidden('module', 'phatform');
         $elements[0] .= PHPWS_Form::formHidden('PHAT_REPORT_OP', 'list');
         $elements[0] .= PHPWS_Form::formSelect('PHAT_ListFilter', $filterOptions, $this->_listFilter, FALSE, TRUE);
         $elements[0] .= PHPWS_Form::formSelect('PDA_limit', $limitOptions, $this->pageLimit, TRUE);
         if (!$_SESSION['PHAT_FormManager']->form->isAnonymous()) {
             $elements[0] .= PHPWS_Form::formTextField('PHAT_EntrySearch', $this->_searchQuery, 20, 255);
         }
         $elements[0] .= PHPWS_Form::formSubmit(dgettext('phatform', 'Search'));
         $listTags['SEARCH_FORM'] = PHPWS_Form::makeForm('PHAT_SearchEntries', 'index.php', $elements);
     }
     $GLOBALS['CNT_phatform']['title'] = $_SESSION['PHAT_FormManager']->form->getLabel();
     return PHPWS_Template::processTemplate($listTags, 'phatform', 'report/list.tpl');
 }
コード例 #17
0
ファイル: InterWiki.php プロジェクト: Jopperi/wiki
 function setUrl($url)
 {
     $this->url = PHPWS_Text::parseInput($url);
 }
コード例 #18
0
ファイル: Sheet.php プロジェクト: HaldunA/phpwebsite
 public function setDescription($description)
 {
     $this->description = PHPWS_Text::parseInput($description);
 }
コード例 #19
0
ファイル: Item.php プロジェクト: par-orillonsoft/phpwebsite
 /**
  * Sets the textual label for this item.
  *
  * Makes sure the label is a valid string and does not contain php or
  * unallowed html tags.
  *
  * @param  string  $label The string to set this item's label to.
  * @return boolean TRUE on success and PHPWS_Error on failure.
  * @access public
  */
 function setLabel($label = NULL)
 {
     if ($label) {
         $this->_label = PHPWS_Text::parseInput($label);
     } else {
         $error = "No label was requested.";
         return new PHPWS_Error("core", "PHPWS_Item::setLabel()", $error);
     }
 }
コード例 #20
0
 function tarEditor()
 {
     if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg", "settings")) {
         //Administrativ condition
         if (isset($_GET['tarEditor'])) {
             $package = PHPWS_Text::parseInput($_GET['tarEditor']);
         } else {
             return FALSE;
         }
         $file_loc = PHPWS_HOME_DIR . "files/xwysiwyg/editors/" . $package;
         $file_onl = "http://www.firebird.ch/xwysiwyg/editors/" . $package;
         //Last check, if the target is writeable
         if (!is_writeable(PHPWS_HOME_DIR . "files/xwysiwyg/editors")) {
             $this->content .= $_SESSION['translate']->it("[var1] does NOT exist or is NOT server writable!", "files/xwysiwyg/editors") . "<br />";
             $this->content .= $_SESSION['translate']->it("Try to create it manually (This may be a SafeMode problem)") . "<br />";
             return FALSE;
         }
         if (!isset($_GET['local'])) {
             //if not local, copy first
             PHPWS_File::fileCopy($file_onl, PHPWS_HOME_DIR . "files/xwysiwyg/editors/", "{$package}", TRUE, TRUE);
         }
         //Now we try to extract the files
         $tar = new Archive_Tar($file_loc);
         $result = $tar->extract(PHPWS_HOME_DIR . "files/xwysiwyg/editors/");
         if (!$result) {
             $this->content .= $_SESSION['translate']->it("Direct install failed!") . "<br />";
         }
     } else {
         $this->content .= $_SESSION['translate']->it("Access was denied due to lack of proper permissions.");
     }
     // End of ADMINISTRATOR condition
 }
コード例 #21
0
ファイル: WikiImage.php プロジェクト: Jopperi/wiki
 function setSummary($summary)
 {
     $this->summary = PHPWS_Text::parseInput($summary);
 }
コード例 #22
0
ファイル: Form.php プロジェクト: HaldunA/phpwebsite
 function setBlurb1($blurb)
 {
     if (is_string($blurb)) {
         $this->_blurb1 = PHPWS_Text::parseInput($blurb);
         return TRUE;
     } else {
         return PHPWS_Error::get(PHATFORM_MESSAGE_FORMAT, 'phatform', 'PHAT_Form::setBlurb1');
     }
 }
コード例 #23
0
ファイル: Textfield.php プロジェクト: HaldunA/phpwebsite
 /**
  * Save this PHAT_Textfield
  *
  * @return string A 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;
     }
     if (!$_SESSION['PHAT_FormManager']->form->checkLabel($_REQUEST['PHAT_ElementName']) && $this->getLabel() != $_REQUEST['PHAT_ElementName'] || PHPWS_Error::isError($this->setLabel(PHPWS_DB::sqlFriendlyName($_REQUEST['PHAT_ElementName'])))) {
         $message = dgettext('phatform', 'The name you entered for the Textfield is not valid or is already in use with this form.');
         $currentError = PHPWS_Error::get(PHATFORM_INVALID_NAME, 'phatform', 'PHAT_Checkbox::save()', $_REQUEST['PHAT_ElementName']);
         $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);
     }
     $size = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementSize']);
     if ($size) {
         $this->_size = $size;
     } else {
         $this->_size = PHAT_DEFAULT_SIZE;
     }
     $maxsize = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementMaxsize']);
     if ($maxsize) {
         $this->_maxsize = $maxsize;
     } else {
         $this->_maxsize = PHAT_DEFAULT_MAXSIZE;
     }
     if ($error) {
         return $currentError;
     } else {
         if (PHPWS_Error::isError($this->commit())) {
             return PHPWS_Error::get(PHATFORM_ELEMENT_FAIL, 'phatform', 'PHAT_Textfield::save');
         } else {
             return sprintf(dgettext('phatform', 'The %s element was saved successfully.'), '<b><i>Textfield</i></b>');
         }
     }
 }
コード例 #24
0
ファイル: Element.php プロジェクト: HaldunA/phpwebsite
 /**
  * Save the options for this PHAT_Element
  *
  * @return mixed  Content if the editing is to continue, PHPWS_Error on failure, or message on success
  * @access public
  */
 function saveOptions()
 {
     $className = get_class($this);
     $properName = ucfirst(str_ireplace('phat_', '', $className));
     if (is_array($_REQUEST['PHAT_ElementOptions']) && is_array($_REQUEST['PHAT_ElementValues'])) {
         $saveText = TRUE;
         $returnText = NULL;
         $saveValues = TRUE;
         $atLeastOne = FALSE;
         if (isset($_REQUEST['PHAT_ElementUseText'])) {
             $_REQUEST['PHAT_ElementValues'] = $_REQUEST['PHAT_ElementOptions'];
             $this->setOptionSet();
         }
         for ($i = 0; $i < sizeof($_REQUEST['PHAT_ElementOptions']); $i++) {
             if ($_REQUEST['PHAT_ElementOptions'][$i] != NULL) {
                 $this->_optionText[$i] = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementOptions'][$i]);
             } else {
                 $this->_optionText[$i] = NULL;
                 $saveText = FALSE;
             }
             if ($_REQUEST['PHAT_ElementValues'][$i] != NULL) {
                 $this->_optionValues[$i] = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementValues'][$i]);
                 $atLeastOne = TRUE;
             } else {
                 $this->_optionValues[$i] = NULL;
                 $saveValues = FALSE;
             }
         }
         if ($className == 'PHAT_Checkbox' || $className == 'PHAT_Multiselect') {
             for ($i = 0; $i < sizeof($_REQUEST['PHAT_ElementOptions']); $i++) {
                 if (isset($_REQUEST['PHAT_ElementDefault']) && isset($_REQUEST['PHAT_ElementDefault'][$i])) {
                     $this->_value[$i] = $_REQUEST['PHAT_ElementValues'][$_REQUEST['PHAT_ElementDefault'][$i]];
                 }
             }
         } else {
             if (isset($_REQUEST['PHAT_ElementDefault'])) {
                 $this->_value = $_REQUEST['PHAT_ElementValues'][$_REQUEST['PHAT_ElementDefault']];
             } else {
                 $this->_value = NULL;
             }
         }
         if ($saveText && $saveValues) {
             if ($_REQUEST['PHAT_SaveOptionSet']) {
                 $label = PHPWS_Text::parseInput($_REQUEST['PHAT_SaveOptionSet']);
                 $options = addslashes(serialize($this->_optionText));
                 $values = addslashes(serialize($this->_optionValues));
                 $saveArray = array('label' => $label, 'optionSet' => $options, 'valueSet' => $values);
                 $db = new PHPWS_DB('mod_phatform_options');
                 $db->addValue($saveArray);
                 $id = $db->insert();
                 if ($id) {
                     $this->setOptionSet($id);
                     $returnText = sprintf(dgettext('phatform', 'The option set %s was successfully saved.'), '<b><i>' . $label . '</i></b>') . '<br />';
                 } else {
                     return PHPWS_Error::get(PHATFORM_OPTION_WONT_SAVE, 'phatform', 'PHAT_Element::saveOptions()', array($label));
                 }
             }
             if (PHPWS_Error::isError($this->commit())) {
                 return PHPWS_Error::get(PHATFORM_ELEMENT_FAIL, 'phatform', 'PHAT_Element::saveOptions()', array($properName));
             } else {
                 $returnText .= sprintf(dgettext('phatform', 'The %s was saved successfully.'), '<b><i>' . $properName . '</i></b>');
                 return $returnText;
             }
         } else {
             if ($atLeastOne) {
                 return PHPWS_Error::get(PHATFORM_VALUES_NOT_SET, 'phatform', 'PHAT_Element::saveOptions()');
             } else {
                 return PHPWS_Error::get(PHATFORM_VAL_OPT_NOT_SET, 'phatform', 'PHAT_Element::saveOptions()');
             }
         }
     } else {
         return PHPWS_Error::get(PHATFORM_ELEMENT_FAIL, 'phatform', 'PHAT_Element::saveOptions()', array($properName));
     }
 }
コード例 #25
0
ファイル: Peeps.php プロジェクト: HaldunA/phpwebsite
 public function setExtraX($extra, &$key)
 {
     $key = PHPWS_Text::parseInput(trim(strip_tags($extra)));
 }