Example #1
0
 function ajaxFormSubmitNormal($page, $params, $senderId, $eventName)
 {
     $result = 'You said: "' . $page->outlet('textField')->value() . '" and "' . $page->outlet('textField2')->value() . '".';
     if (WFRequestController::sharedRequestController()->isAjax()) {
         return WFActionResponsePhocoaUIUpdater::WFActionResponsePhocoaUIUpdater()->addUpdateHTML('ajaxFormResult', $result);
     } else {
         $page->assign('formResult', $result);
     }
 }
Example #2
0
 function regexRun($page, $params)
 {
     $showResult = "No matches.";
     $matches = array();
     switch ($page->outlet('regexMatchType')->value()) {
         case 'preg_match_all':
             if (preg_match_all('/' . $page->outlet('regexExpression')->value() . '/', $page->outlet('regexTarget')->value(), $matches)) {
                 $showResult = "<pre>";
                 //$showResult .= print_r($matches, true);
                 for ($j = 0; $j < count($matches[0]); $j++) {
                     $showResult .= "\n\nMatched: {$matches[0][$j]}";
                     for ($i = 0; $i < count($matches); $i++) {
                         $showResult .= "\n{$i}: {$matches[$i][$j]}";
                     }
                 }
                 $showResult .= "</pre>";
             }
             break;
         case 'preg_match':
             if (preg_match('/' . $page->outlet('regexExpression')->value() . '/', $page->outlet('regexTarget')->value(), $matches)) {
                 $showResult = "<pre>";
                 for ($i = 0; $i < count($matches); $i++) {
                     if ($i == 0) {
                         $showResult .= "\nMatched: {$matches[0]}\n\n";
                     } else {
                         $showResult .= "\n{$i}: {$matches[$i]}";
                     }
                 }
                 $showResult .= "</pre>";
             }
             break;
     }
     if (WFRequestController::sharedRequestController()->isAjax()) {
         return WFActionResponsePhocoaUIUpdater::WFActionResponsePhocoaUIUpdater()->addUpdateHTML('regexResult', $showResult);
     } else {
         print $showResult;
         exit;
     }
 }
Example #3
0
 function ajaxButton3($page, $params)
 {
     $page->assign('ajaxButtonPressed', 'Third button');
     if (WFRequestController::sharedRequestController()->isAjax()) {
         return WFActionResponsePhocoaUIUpdater::WFActionResponsePhocoaUIUpdater()->addUpdateHTML('ajaxButtonPressed', 'Third Button');
     }
 }
Example #4
0
 function generatePopupHTML($page, $params, $popupSelections, $treeViewPath)
 {
     $dpSearch = $this->dieselSearchHelper->dieselSearch();
     $dpSearch->setResultObjectLoaderCallbackWithPropelPeer(NULL);
     $this->dieselSearchHelper->buildQuery();
     $dpSearch->execute();
     $this->setPopupSelections($popupSelections);
     $this->setIsPopup(true);
     if ($treeViewPath) {
         $path = str_replace('|', "\t", $treeViewPath);
         $this->setTreeDataPath($path);
     }
     $facetHTML = $this->render();
     if ($facetHTML === NULL) {
         $facetHTML = "No items have " . $this->label() . " data.";
     }
     $updateId = "phocoaWFDieselNav_PopupContent_{$this->parent()->id()}";
     return WFActionResponsePhocoaUIUpdater::WFActionResponsePhocoaUIUpdater()->addUpdateHTML($updateId, $facetHTML);
 }