This file contains hidden or 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
/** | |
* OpenSSL encrypt/decrypt for ProcessWire | |
* | |
* $encryptDecrypt = new \ProcessWire\OpenSSLencryptDecrypt(); | |
* $encrypted = $encryptDecrypt->encrypt('My Text'); | |
* $decrypted = $encryptDecrypt->decrypt($encrypted); | |
*/ | |
class OpenSSLencryptDecrypt extends Wire { | |
/** |
This file contains hidden or 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
// $pfields = $page->templates->fields; | |
$fg = $fieldgroups->get('item'); | |
$allFields = $fg->fields->getAll(); | |
$item = $pages->get('template=item'); | |
$allFields = $item->template->fields; | |
$lorem_long = array( |
This file contains hidden or 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 namespace ProcessWire; | |
require($config->paths->templates . 'Spout/Autoloader/autoload.php'); | |
use Box\Spout\Writer\WriterFactory; | |
use Box\Spout\Common\Type; | |
This file contains hidden or 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
/** | |
* Mapping 01 | |
* | |
* Text manipulator for the set name. The set name must be compatible with Page name. | |
* | |
*/ | |
$(function () { | |
/** | |
* Build valid/restricted filenames |
This file contains hidden or 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
/** | |
* Installer: HTTP Hosts Whitelist | |
* | |
*/ | |
$config->httpHosts = array('domain-01.dev', 'domain-02.dev', 'domain-03.dev', 'domain-04.ext'); | |
/** | |
* Development settings (Switch settings based on domainname.) | |
* |
This file contains hidden or 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 | |
/** | |
* Replace PW page variable in field descriptions and notes, eg: [Click Here]({page.parent.url}) | |
* for creating a link to the parent page. | |
* | |
* @author adrianbj (https://gist.github.com/adrianbj/5dc1c00f1617b2639319) | |
*/ | |
class DescriptionNoteVariables extends WireData implements Module { |
This file contains hidden or 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 | |
function getPartial($path_to_file) { | |
ob_start(); | |
include($path_to_file); | |
return ob_get_clean(); | |
} | |
$partial = getPartial($config->urls->templates . 'partials/myfile.php'); |
This file contains hidden or 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 | |
array('icon-glass','music','search','envelope-alt','heart','star','star-empty','user','film','th-large','zoom-out','off','signal','cog','trash','home','file-alt','time','road','download-alt','refresh','list-alt','lock','flag','headphones','volume-off','volume-down','volume-up','qrcode','camera','font','bold','italic','text-height','text-width','align-left',''align-center','align-right','align-justify','pencil','map-marker','adjust','tint','edit','share','check','move','step-backward','fast-backward','fast-forward','step-forward','eject','chevron-left','chevron-right','plus-sign','minus-sign','remove-sign','ok-sign','question-sign','arrow-left','arrow-right','arrow-up','arrow-down','share-alt','resize-full','resize-small','plus','minus','asterisk','eye-close','warning-sign','plane','calendar','random','comment','magnet','chevron-up','chevron-down','retweet','bar-chart','twitter-sign','facebook-sign','camera-retro','key','cogs','comments','thumbs-up-alt','thumbs-down-alt','star-half','signin','trophy','gi |
This file contains hidden or 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 | |
// Module from ryan.... | |
class CustomPageRoles extends WireData implements Module { | |
/** | |
* Provide information about this module to ProcessWire | |
* | |
*/ |
This file contains hidden or 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
// author: http://jeffreysambells.com/2012/10/25/human-readable-filesize-php | |
function human_filesize($bytes, $decimals = 2) { | |
$size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB'); | |
$factor = floor((strlen($bytes) - 1) / 3); | |
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor]; | |
} |
NewerOlder