Skip to content

Instantly share code, notes, and snippets.

View leceles's full-sized avatar

Leandro Celes leceles

View GitHub Profile
@leceles
leceles / concrete5.php
Created November 4, 2012 22:19
c5 - get list of every attribute key avaible for pages
Loader::model('attribute/key');
Loader::model('attribute/categories/collection');
$list = AttributeKey::getList('collection',array('atID'=>$atID));
@leceles
leceles / form.php
Created November 1, 2012 17:42
c5 - page selector form concrete5
<?php
$formhelper = Loader::helper('form/page_selector');
echo $formhelper->selectPage($fieldName,$cID = false, $javascriptFunc = 'ccm_selectSitemapNode');
?>
@leceles
leceles / concrete5 block
Created October 31, 2012 03:40
c5 - get the block view from the controller
$bv = new BlockView();
$bv->setBlockObject($this->getBlockObject());
//Now $bv should be the same as $this was in the view, so you could do this:
$areaname = $bv->block->getAreaHandle();
@leceles
leceles / gist:3970095
Created October 28, 2012 22:01
c5 #image #imagehelper
if (!empty($imageid)) {
$img = File::getByID($imageid);
$ih = Loader::helper('image');
$img = $ih->getThumbnail($img,35,35,false);
$imgsrc = $img->src;
}
@leceles
leceles / fontfaces.less
Created October 28, 2012 03:14
less - font face mixen
//mixen de fazer fontfaces
@fontpath: "../fonts/";
//mixen para geração de fontes
#fontutilits{
.fontface(@filename,@nome,@wight:normal){
font-family: @nome ;
src: url('@{fontpath}@{filename}.eot');