Skip to content

Instantly share code, notes, and snippets.

@MiLk
Last active August 29, 2015 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiLk/7db36223bd69a63c1d74 to your computer and use it in GitHub Desktop.
Save MiLk/7db36223bd69a63c1d74 to your computer and use it in GitHub Desktop.
CraftaShop fix
<?php
// controller/AdminController.php
function description($action=null) {
$this->loadModel("Configs");
$datas["configs"] = $this->Configs->listed("Presentation");
$datas["messages"] = $this->Configs->listed("Message");
$this->set($datas);
if ($this->request->data) {
$update = false;
foreach ($this->request->data as $key => $value) {
if($key != "checkbox") {
$update = $this->Configs->updt(array('config_text' => $value), $key) && update;
}
}
if ($update) {
$this->Session->setFlash("Félicitations, vous venez de modifier la description.", "success");
}
$this->redirect("previous");
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment