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
$("form :input").each(function(index, elem) { | |
var eId = $(elem).attr("id"); | |
var label = null; | |
if (eId && (label = $(elem).parents("form").find("label[for="+eId+"]")).length == 1) { | |
$(elem).attr("placeholder", $(label).text()); | |
$(label).remove(); | |
} | |
}); |
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 | |
/* | |
1. Source code lines are limited to 120 characters | |
2. 0 space expected after first parenthesis of function | |
3. Opening brace should be on a new line | |
Ça donne un truc illisible | |
*/ | |
public function getCategories($id_lang = false, |
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 | |
class Product extends ProductCore{ | |
public static function getProductProperties($id_lang, $row, Context $context = null) | |
{ | |
$row = parent::getProductProperties($id_lang, $row, $context); | |
if (is_array($row) && isset($row['id_product'])) { | |
$usetax = Tax::excludeTaxeOption(); | |
$cache_key = $row['id_product'].'-'.$row['id_product_attribute'].'-'.$id_lang.'-'.(int)$usetax; |
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 test() | |
{ | |
for ($i = 0; $i < 17; $i++) { | |
if ($myArray[$i] == $value) { | |
$result[] = $myArray[$i]; | |
for ($i = 0; $i < 17; $i++) { | |
if ($myArray[$i] == $value) { | |
$failed++; | |
} else { |
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 test() | |
{ | |
for ($i = 0; $i < 17; $i++) | |
if ($myArray[$i] == $value) | |
{ | |
$result[] = $myArray[$i]; | |
for ($i = 0; $i < 17; $i++) | |
if ($myArray[$i] == $value) | |
$failed++; |
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 | |
class ExampleModule extends Module { | |
public function install() | |
{ | |
$done = ( | |
parent::install() | |
&& $this->registerHook('displayFooter') | |
&& $this->registerHook('displayRandom') | |
); | |
return $done; |
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 | |
class Samdha_IDoSomething() | |
{ | |
private $messager; | |
function __construct() | |
{ | |
// crée le gestionnaire de message | |
$this->messager = new Prestashop_Messager(); | |
} |
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 | |
class ObjectModel extends ObjectModelCore | |
{ | |
public function add($autodate = true, $nullValues = false) | |
{ | |
$result = parent::add($autodate, $nullValues); | |
if ($result) Module::hookExec('objectAdd', array('object' => $this)); | |
return $result; | |
} |
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 | |
/** | |
* return true if the module $name is activated in apache | |
* | |
* @param string $name module name | |
* @return boolean | |
* @author Samdha | |
**/ | |
function detect_apache_mod($name) { |
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 | |
/** | |
* do the same than parse_str without max_input_vars limitation | |
* @param $string array string to parse | |
* @return array query parsed | |
**/ | |
function my_parse_str($string) { | |
$result = array(); | |
// find the pairs "name=value" |