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
// renders markup for a Bootstrap 3 Carousel from a ProcessWire images array | |
function bsCarouselMarkup($images) { | |
$carouselId = $images->get('page').$images->get('field')->id; | |
$carouselMarkup = "<div id='carousel-$carouselId' class='carousel slide' data-ride='carousel'> | |
<ol class='carousel-indicators'>"; | |
$i = 0; | |
foreach ($images as $image) : | |
$class = ($i == 0) ? " class='active'" : ""; | |
$carouselMarkup .= "<li data-target='#carousel-$carouselId' data-slide-to='$i'$class ></li>"; | |
$i++; |
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 | |
/** | |
* @version SEBLOD 3.x More ~ $Id: index.php sebastienheraud $ | |
* @package SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder) | |
* @url http://www.seblod.com | |
* @editor Octopoos - www.octopoos.com | |
* @copyright Copyright (C) 2013 SEBLOD. All Rights Reserved. | |
* @license GNU General Public License version 2 or later; see _LICENSE.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 | |
/* | |
* 401 Response | |
* | |
* Sends a 401 Response Unauthorized | |
* | |
* @author Camilo Castro | |
* | |
* @date 29/07/2014 |
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
/*render a Bootstrap 3 accordion from a PW PageArray | |
variables passed to this function | |
$pages: PageArray the children of which will be rendered into an accordion | |
$title: string, name of the field to be used as panel title, eg "title" | |
$content: string, name of the field to be used as panel content, eg "bodycopy" | |
$accordion = "<div class='panel-group' id='accordion' role='tablist' aria-multiselectable='true'>"; | |
*/ | |
function bs3AccordionMarkup($pages, $titlefield, $contentfield) { | |
$accordion = "<div class='panel-group' id='accordion' role='tablist' aria-multiselectable='true'>"; |
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 | |
function swapLanguages($pages, $lang) { | |
$startTime = microtime(true); | |
$langDefault = "default"; | |
$log = ["languages" => "Swap field values for language {$langDefault} with {$lang}", "pages" =>[]]; | |
$languages = wire("languages"); | |
// get languages | |
$l1 = $languages->get($langDefault); |
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
// example code | |
// convert the saved date of the page to a timestamp | |
// $date = strtotime($page->date); | |
$date = strtotime("12-January-2016"); | |
// convert the $searchdate to a timestamp | |
$searchdate = strtotime("January-2016") + 1000; | |
// get first and last timestamp of the given month and year | |
$getdate = getdate($searchdate); | |
// get the month number (e.g. 1 for January) | |
$month = $getdate["mon"]; |
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
/** | |
* Display a Leaflet Map and pinpoint a location for InputfieldLeafletMapMarker | |
* | |
*/ | |
var InputfieldLeafletMapMarker = { | |
options: { | |
zoom: 9, | |
draggable: true, |
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
// Alerts | |
@include alert-variant($background, $border, $text-color); | |
// Background Variant | |
@include bg-variant($parent, $color); | |
// Border Radius | |
@include border-top-radius($radius); | |
@include border-right-radius($radius); | |
@include border-bottom-radius($radius); |
OlderNewer