Esempio n. 1
0
function getReplaceChars($object, $name = "")
{
    switch ($name) {
        case "products":
            return array("%%ID%%" => $object->getId(), "%%NAME%%" => $object->getName(), "%%DESCRIPTION%%" => $object->getDescription(), "%%PICTURE%%" => $object->getPicture());
            break;
        case "gallery":
            return array("%%ID%%" => $object->getId(), "%%NAME%%" => $object->getName(), "%%DESCRIPTION%%" => $object->getDescription(), "%%PICTURE%%" => $object->getFirstPicture(), "%%LIEN%%" => Functions::getDefaultURL() . "portfolio/" . $object->getId() . "_" . str_replace(" ", "_", $object->getName()));
            break;
        case "improve":
            return array("%%ID%%" => $object->getId(), "%%NAME%%" => $object->getName(), "%%CONTENT%%" => $object->getContent(), "%%PICTURE%%" => $object->getPicture());
            break;
        case "improve1":
            return array("%%ID%%" => $object->getId());
            break;
        case "slide":
            return array("%%PICTURE%%" => $object->getPicture());
            break;
        case "category":
            $product = Models::getProductObject();
            $product->fetchProductByCategoryId($object->getId());
            return array("%%ID%%" => $object->getId(), "%%NAME%%" => $object->getName(), "%%CATEGORY_URL%%" => Functions::getDefaultURL() . "product/" . str_replace(" ", "_", $object->getName()), "%%PICTURE%%" => $object->getPicture(), "%%LOGO%%" => $object->getLogo(), "%%DESCRIPTION%%" => $object->getDescription(), "%%COUNT%%" => $product->getCount(), "%%SELECTED%%" => defined("CATEGORY_NAME") && $object->getIdFromName(str_replace("_", " ", CATEGORY_NAME)) == $object->getId() ? "selected" : "");
            break;
    }
    return array();
}
Esempio n. 2
0
function getReplaceChars($object, $name = "")
{
    switch ($name) {
        case "product":
            $category = Models::getCategoryObject();
            return array("%%TITLE%%" => $object->getName(), "%%DESCRIPTION%%" => $object->getDescription(), "%%CATEGORYID%%" => $object->getCategoryId(), "%%CATEGORY%%" => $category->getNameFromId($object->getCategoryId()), "%%PICTURE%%" => $object->getPicture());
            break;
        case "category":
            $product = Models::getProductObject();
            $product->fetchProductByCategoryId($object->getId());
            return array("%%ID%%" => $object->getId(), "%%NAME%%" => $object->getName(), "%%CATEGORY_URL%%" => Functions::getDefaultURL() . "product/" . str_replace(" ", "_", $object->getName()), "%%PICTURE%%" => $object->getPicture(), "%%DESCRIPTION%%" => $object->getDescription(), "%%COUNT%%" => $product->getCount(), "%%SELECTED%%" => defined("CATEGORY_NAME") && $object->getIdFromName(str_replace("_", " ", CATEGORY_NAME)) == $object->getId() ? "selected" : "");
            break;
    }
    return array();
}