Skip to content

Instantly share code, notes, and snippets.

View romaninsh's full-sized avatar
🚴‍♂️
Focusing

Romans Malinovskis romaninsh

🚴‍♂️
Focusing
View GitHub Profile
<?php
class Form extends Form_Basic {
public $split_columns=true;
function init(){
parent::init();
$this->setFormClass('stacked atk-row');
}
function recursiveRender(){
if(count($this->elements)>8 && $this->split_columns){
$o=$this->add('Order')
class Controller_Element extends Controller {
function addFields($m){
$m->addField('name');
$m->hasOne('Profile','owner_profile_id');
$m->hasOne('User','created_by');
$m->addField('element_type');
$m->addField('descr')->type('text')->caption('Description');
$m->addField('seo_name');
$m=$this;
$m->thumb=$m
->leftJoin('filestore_file','filestore_file_id')
->leftJoin('filestore_image.original_file_id',null,'left')
->leftJoin('filestore_file','thumb_file_id','left');
;
$m->vol=$m->thumb->leftJoin('filestore_volume',null,'left');
$m->addExpression('thumb',function($m,$s){
this.element.find('tbody').selectable({
filter: 'tr',
cancel: '.ui-button,a,:input,option',
stop: function(){ c
hb.stop.apply(chb,[this])
}
}).css({cursor:'crosshair'});
#!/bin/bash
if [ $# -lt 1 -o $# -gt 4 ]
then
echo "Usage: $0 log_to_be_checked [cc-emails [to-email [subject]]]" >&2
exit 1
fi
LOGFILE="$1"
TSFILE="${LOGFILE}.ts"
@romaninsh
romaninsh / atk-demo-1.php
Created November 1, 2010 02:42
Simple Grid on Agile Toolkit , PHP5
<?php
$g=$p->add('Grid');
// All the new views or objects needs to be added. When you do that - new object becomes child. This determines location where it appears on the page.
// For example $p is the "Demo" tab. What you add into $p will always be in there.
$g->addColumn('name');
// You can define multiple columns inside grid using addColumn() method. Columns must correspond with the hash keys in the data