Пример #1
0
function lister_contenuassoc($type, $objet)
{
    foreach (AssociatedContentAdmin::getInstance()->getList($type, $objet) as $content) {
        ?>
        <tr class="content_liste">
            <td><?php 
        echo $content["folder_titre"];
        ?>
</td>
            <td><?php 
        echo $content["content_titre"];
        ?>
</td>
            <td><a href="#" class="content-delete" data-content="<?php 
        echo $content["id"];
        ?>
"><i class="icon-trash"></i></a></td>
        </tr>
    <?php 
    }
}
 public function modify($lang, $parent, $lien, $online, $title, $chapo, $description, $postscriptum, $urlsuiv, $rewriteurl, $associatedContents, $associatedFeatures, $associatedVariants, $images, $documents, $tab)
 {
     if ($this->id == '') {
         throw new TheliaAdminException("Category not found", TheliaAdminException::CATEGORY_NOT_FOUND);
     }
     $rubriquedesc = new Rubriquedesc($this->id, $lang);
     if ($rubriquedesc->id == '') {
         CacheBase::getCache()->reset_cache();
         $rubriquedesc->rubrique = $this->id;
         $rubriquedesc->lang = $lang;
         $rubriquedesc->id = $rubriquedesc->add();
     }
     $this->oldParent = $this->parent;
     if ($this->parent != $parent) {
         $this->checkOrder($parent);
     }
     $this->parent = $parent;
     $this->lien = $lien;
     $this->ligne = $online == 'on' ? 1 : 0;
     $rubriquedesc->chapo = str_replace("\n", "<br />", $chapo);
     $rubriquedesc->titre = $title;
     $rubriquedesc->postscriptum = $postscriptum;
     $rubriquedesc->description = $description;
     $this->maj();
     $rubriquedesc->maj();
     $rubriquedesc->reecrire($rewriteurl);
     $this->setLang($lang);
     AssociatedContentAdmin::getInstance()->updateAssociatedContents(0, $this->id, $associatedContents);
     AssociatedVariantAdmin::getInstance()->updateAssociatedVariants($this->id, $associatedVariants);
     AssociatedFeatureAdmin::getInstance()->updateAssociatedFeatures($this->id, $associatedFeatures);
     $this->updateImage($images);
     $this->getImageFile()->ajouter("photo", array("jpg", "gif", "png", "jpeg"), "uploadimage");
     $this->updateDocuments($documents);
     $this->getDocumentFile()->ajouter("document_", array(), "uploaddocument");
     ActionsModules::instance()->appel_module("modrub", new Rubrique($this->id));
     if ($urlsuiv) {
         redirige('parcourir.php?parent=' . $this->rubrique);
     } else {
         redirige('rubrique_modifier.php?id=' . $this->id . '&tab=' . $tab . '&lang=' . $lang);
     }
 }
                    <div class="tab-pane <?php 
if ($tab == 'associationTab') {
    ?>
 active<?php 
}
?>
" id="associationTab">
                        
                        <h3 id="associatedContentAnchor">
                            <?php 
echo trad('GESTION_CONTENUS_ASSOCIES', 'admin');
?>
                        </h3>
                        <input type="hidden" id="new_associated_content" name="new_associated_content" value="" />
<?php 
$AClist = AssociatedContentAdmin::getInstance()->getList(0, $rubrique->id);
for ($i = 0; $i < count($AClist); $i++) {
    ?>
                        <input type="hidden" id="alive_associated_content_<?php 
    echo $AClist[$i]['id'];
    ?>
" name="alive_associated_content_<?php 
    echo $AClist[$i]['id'];
    ?>
" class="js-deleted-associated-content" js-id-content="<?php 
    echo $AClist[$i]['content_id'];
    ?>
" js-id-associated-content="<?php 
    echo $AClist[$i]['id'];
    ?>
" value="1" />