Skip to content

Instantly share code, notes, and snippets.

View putzflorian's full-sized avatar

Florian Putz putzflorian

  • @elements-at
  • Salzburg
  • 11:01 (UTC +02:00)
View GitHub Profile
@putzflorian
putzflorian / MediaQueries.css
Created June 8, 2014 11:02
Media Queries for Standard Devices
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@putzflorian
putzflorian / importRedirects.php
Created April 3, 2014 13:43
Import Redirects in Pimcore
<?php
$today = new Zend_Date();
$today->add(6, Zend_Date::MONTH);
$time = $today->getTimestamp();
$rd = new InsertRedirect();
$row = 1;
if (($handle = fopen("redirects.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 10000, ";")) !== FALSE) {
@putzflorian
putzflorian / qrcode.php
Created March 7, 2014 09:19
Render qr codes
<?php
public function QrcodeAction () {
$url = $this->getParam("url");
$codeSettings = array(
'text' => $url,
'backgroundColor' => '#FFFFFF',
'foreColor' => '#000000',
'padding' => 0, //array(10,5,10,5),
'moduleSize' => 10
@putzflorian
putzflorian / httpsredirect.php
Last active August 29, 2015 13:57
HTTPS umleitung Action Controller
<?php
$document_path = $this->_request->getPathInfo();
if(!Pimcore_Tool::isFrontentRequestByAdmin()){
$pos = strpos($document_path, '/' . $this->language . '/tosc4');
if($pos === false && $_SERVER['SERVER_PORT'] == 443){
Pimcore_Model_Cache::disable();
$this->_redirect('http://www.domain.at' . $document_path, array('code' => 301));
}
@putzflorian
putzflorian / wrap.php
Last active September 1, 2016 09:21
warp div's php
<?php
$count = 1;
foreach( $users_kicks as $kicks ) {
if ($count%4 == 1){
echo "<div>";
}
echo $kicks->brand;
if ($count%4 == 0){
echo "</div>";
@putzflorian
putzflorian / siteredirect.php
Last active August 29, 2015 13:56
redirect Pimcore Site Request
<?php
// redirect site
if(!Pimcore_Tool::isFrontentRequestByAdmin()){
$d = preg_match('/region\/(.*)/', $this->_request->getPathInfo(), $matches);
if($d){
$this->redirect('http://www.newdomain.at/' . $matches[1], array('code' => 301));
}
}
<ol class="breadcrumb">
<?php
$breadcrumbNavigation = $this->pimcoreNavigation()->getNavigation($this->document, Document::getByPath('/' . $this->language));
echo $this->navigation()->breadcrumbs()->setUseTranslator(false)->setMinDepth(null)->renderPartial($breadcrumbNavigation, "/navigation/partials/breadcrumb.php");
?>
</ol>
@putzflorian
putzflorian / Zend_View_Helper.php
Last active February 10, 2017 19:08
Zend_View_Helper
<?php
$this->getRequest()->getPost('id', null);
$this->headScript()->appendFile('/static/js/parsley.js','text/javascript');
$this->headLink()->appendStylesheet('/static/css/themenuebersicht.css');
// get snippet path
$this->snippet("xyz")->getSnippet()->getFullPath()
@putzflorian
putzflorian / facebookresize.js
Created October 28, 2013 10:49
Facebook IFRAME AutoResize
<script src="https://connect.facebook.net/en_US/all.js"></script>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'XXX-XXXX', //Your facebook APP here
cookie : true // enable cookies to allow the server to access the session
});
}
window.onload = function() {
@putzflorian
putzflorian / Object.keys.js
Created August 19, 2013 11:40
Object.keys for IE8
Object.keys = Object.keys || (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"),
DontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',