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 | |
/* creates a compressed zip file */ | |
function create_zip($files = array(),$destination = '',$overwrite = false) { | |
if(file_exists($destination) && !$overwrite) { return false; } | |
if(is_array($files)) { | |
foreach($files as $name => $file) { | |
if(!file_exists($file)) unset($files[$name]); | |
} | |
} |
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 | |
/** | |
* ProcessWire example demonstration module | |
* | |
* PageListActionHook autoload module once installed will remove "new" action from second level pages | |
* using the template "basic-page" | |
* | |
*/ |
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 | |
class download{ | |
public function startDownload( $vFilePath, $vDownloadName=""){ | |
$vFilename = basename( $vFilePath); | |
$vNewFilename = $vDownloadName == "" ? $vFilename : $vDownloadName; | |
$vFileType = $this->getFileType( $vFilename); | |
$vContentType = $this->GetContentType( $vFileType); | |
// Fix IE bug [0] |
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. |
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 | |
/** | |
* include paginator class from ProcessWire core, $config->paths->Modulename can | |
* be used to get the path of any module in PW. | |
*/ | |
require_once($config->paths->MarkupPagerNav . "PagerNav.php"); | |
/** |
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 | |
/** | |
* ProcessWire PageReferenceLink | |
* | |
* @author Soma philipp(at)urlich.ch | |
* | |
* | |
* ProcessWire 2.x | |
* Copyright (C) 2010 by Ryan Cramer |
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 MyHelper extends WireData implements Module { | |
/** | |
* getModuleInfo is a method required by all modules to tell ProcessWire about them | |
* @return array | |
*/ | |
public static function getModuleInfo() { | |
return array( | |
'title' => 'My Helper Module', |