From: Thomas Mudrunka Date: Sat, 22 Oct 2011 14:20:54 +0000 (+0200) Subject: Je mozny vygooglit model jednim kliknutim, escapuje se URL v relacnich lincich X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=d516a31d1ee927ed08b0147808b5a7d890742ace;p=mirrors%2FSokoMan.git Je mozny vygooglit model jednim kliknutim, escapuje se URL v relacnich lincich --- diff --git a/index.php b/index.php index 7361d30..40b215f 100755 --- a/index.php +++ b/index.php @@ -296,7 +296,8 @@ EOF; $relations = array( //TODO: Autodetect??? 'model' => array( 'model_id' => array(array('item',$where_url)), - 'model_barcode' => array(array('store','assistant/%d?barcode=%v')) + 'model_barcode' => array(array('store','assistant/%d?barcode=%v')), + 'model_name' => array(array('google','http://google.com/search?q=%v',true)) ), 'item' => array( 'item_serial' => array(array('dispose','assistant/%d?serial=%v'),array('sell','assistant/%d?serial=%v')) @@ -313,10 +314,10 @@ EOF; foreach($relations[$class][$column] as $destination) { $destination_url = str_replace( array('%d','%c','%v'), - array($destination[0],$column,$value), + array(urlencode($destination[0]),urlencode($column),urlencode($value)), $destination[1] ); - @$table[$id][$class.$suffix_relations] .= $this->link($destination[0], $destination_url).','; + @$table[$id][$class.$suffix_relations] .= $this->link($destination[0], $destination_url, !isset($destination[2])).','; } } }