Skip to content

Instantly share code, notes, and snippets.

@kongondo
kongondo / AddPageFieldProperty.module
Created June 7, 2013 09:18 — forked from somatonic/AddPageFieldProperty.module
add page field as property to page example
<?php
/**
* ProcessWire AddPageFieldProperty demonstration module
*
*
* ProcessWire 2.x
* Copyright (C) 2010 by Ryan Cramer
* Licensed under GNU/GPL v2, see LICENSE.TXT
*
@kongondo
kongondo / MapPageField.module
Created June 7, 2013 09:18 — forked from somatonic/MapPageField.module
maps two page fields POC
<?php
class MapPageField extends WireData implements Module{
public static function getModuleInfo(){
return array(
'title' => 'MapPageField',
'version' => 100,
'singular' => true,
'autoload' => true
@kongondo
kongondo / find matches example
Created June 7, 2013 09:20 — forked from somatonic/find matches example
PW search and find matches
$words = '';
$q = $sanitizer->selectorValue($input->post->q);
$words = explode(' ', $q);
foreach($words as $word) {
$word = $sanitizer->selectorValue($word);
if($word) $selectorEmergencyContacts .= "title|label_$lang*=$word, ";
}
...
@kongondo
kongondo / breadcrumbs.php
Created June 7, 2013 09:21 — forked from somatonic/breadcrumbs.php
PW breadcrumb code
foreach($page->parents as $p) echo "<a href='$p->url'>$p->title</a>";
@kongondo
kongondo / ModuleName.module
Created June 7, 2013 09:21 — forked from somatonic/ModuleName.module
ProcessWire Module Template. It demonstrates the Module interface and how hooks are added
<?php
/**
* ProcessWire Module Template
*
* Demonstrates the Module interface and how to add hooks.
*
* ProcessWire 2.x
* Copyright (C) 2010 by Ryan Cramer
* Licensed under GNU/GPL v2, see LICENSE.TXT
<?php
/*
*
*
*
*/
class ProcessDashboard extends Process {
@kongondo
kongondo / download.php
Created June 7, 2013 09:22 — forked from somatonic/download.php
A Download PHP Class
<?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]
@kongondo
kongondo / PageReferenceLink.module
Created June 7, 2013 09:23 — forked from somatonic/PageReferenceLink.module
Add link from page reference fields - Module example
@kongondo
kongondo / FieldHelper.module
Created June 7, 2013 09:23 — forked from somatonic/FieldHelper.module
FieldHelper Module
<?php
/**
* ProcessWire Module FieldHelper
*
*
* ProcessWire 2.x
* Copyright (C) 2010 by Ryan Cramer
* Licensed under GNU/GPL v2, see LICENSE.TXT
*
@kongondo
kongondo / TextAreaCounter.module
Created June 7, 2013 09:24 — forked from somatonic/TextAreaCounter.module
TextAreaCounter concept module
<?php
// start module to textarea counter
class TextAreaCounter extends WireData implements Module {
//const default_maxlength = 255;
/**
* getModuleInfo is a module required by all modules to tell ProcessWire about them