This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// check if there are GET variables present in the URL | |
if(count($input->get)) { | |
$selector = ''; | |
if($input->get->application) { | |
$application = $sanitizer->pageName($input->get->application); | |
$appid = $pages->get("template=product-options, name=$application"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name='search' id='product-search' method='get' action='<?php echo $config->urls->root?>speaker-finder/'> | |
<ul id="row1"> | |
<li> | |
<label for='search_app'>Application</label> | |
<select id='search_app' name='application' onchange="$(this.form).trigger('submit')"> | |
<option value=''>Any</option><?php | |
// generate the application options, checking the whitelist to see if any are already selected | |
foreach($pages->get(1016)->children('include=all') as $app) { | |
$selected = $app->name == $input->whitelist->application ? " selected='selected' " : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ImageCreateThumbs extends WireData implements Module { | |
public static function getModuleInfo() { | |
return array( | |
'title' => 'ImageCreateThumbs', | |
'version' => 100, | |
'summary' => '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$out = ''; | |
// create a new form field (also field wrapper) | |
$form = $modules->get("InputfieldForm"); | |
$form->action = "./"; | |
$form->method = "post"; | |
$form->attr("id+name",'subscribe-form'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// get a page | |
$editpage = $pages->get("/editme/"); | |
$ignorefields = array("isOld","language_published"); | |
$form = $modules->get("InputfieldForm"); | |
$form->method = 'post'; | |
$form->action = './'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// front-end form example with multiple images upload | |
// add new page created on the fly and adding images | |
$message = ''; | |
if($input->post->submit){ | |
// tmp upload folder for additional security |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ------------------------------ FORM Processing --------------------------------------- | |
$errors = null; | |
$success = false; | |
// helper function to format form errors | |
function showError($e){ | |
return "<p class='error'>$e</p>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Front-end upload form example | |
* using ProcessWire Inputfields | |
*/ | |
$sent = false; | |
$upload_path = $config->paths->assets . "files/.tmp_uploads/"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Example form using PW API | |
* | |
* A workaround to get fields display in a table | |
* Those fields are marked with a property added to the fields $field->tablerow | |
* | |
* Approach is to grab those fields after form is put together and maybe processed, | |
* loop each row and render out the fields along with possible errors and add it to a string variable $table | |
* while we remove the field from the form at the same time. |
OlderNewer