芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/clients/canaldegap.fr_old/modules/faq/method.install.php
cms->db; $dict = NewDataDictionary($db); // mysql-specific, but ignored by other database $taboptarray = array("mysql" => "TYPE=MyISAM"); // Creates the rubrique table $flds = " description X, template X, id I KEY, name C(64), alias C(64), item_order I, active L, isdefault L, date_modified ".CMS_ADODB_DT.", date_created ".CMS_ADODB_DT." "; $sqlarray = $dict->CreateTableSQL(cms_db_prefix()."module_faq_rubrique", $flds, $taboptarray); $dict->ExecuteSQLArray($sqlarray); $db->CreateSequence(cms_db_prefix()."module_faq_rubrique_seq"); // Creates the terme table $flds = " definition X, parent I, id I KEY, name C(64), alias C(64), item_order I, active L, isdefault L, date_modified ".CMS_ADODB_DT.", date_created ".CMS_ADODB_DT." "; $sqlarray = $dict->CreateTableSQL(cms_db_prefix()."module_faq_terme", $flds, $taboptarray); $dict->ExecuteSQLArray($sqlarray); $db->CreateSequence(cms_db_prefix()."module_faq_terme_seq"); // Creates the table for multiple files $flds = " fileid I, itemid I, fieldname C(64), filepath C(255) "; $sqlarray = $dict->CreateTableSQL(cms_db_prefix()."module_faq_multiplefilesfields", $flds, $taboptarray); $dict->ExecuteSQLArray($sqlarray); $db->CreateSequence(cms_db_prefix()."module_faq_multiplefilesfields_seq"); // Creates the queries table $flds = " id I, name C(64), what C(32), whereclause C(255), wherevalues C(255), queryorder C(32) "; $sqlarray = $dict->CreateTableSQL(cms_db_prefix()."module_faq_saved_queries", $flds, $taboptarray); $dict->ExecuteSQLArray($sqlarray); $db->CreateSequence(cms_db_prefix()."module_faq_saved_queries_seq"); // INSERTING DEFAULT TEMPLATES $template = '
{$leveltitle}
{if $itemcount > 0}
{foreach from=$itemlist item="item"}
is_selected}class="active"{/if}>{$item->detaillink}
{/foreach}
{if $page_pagenumbers}
{$page_previous} {$page_showing}/{$page_totalitems} {$page_next}
{$page_pagenumbers}
{/if} {else}
{$error_msg}
{/if} '; $this->SetTemplate("list_default",$template,$this->GetName()); $this->SetPreference("listtemplate_rubrique","list_default"); $this->SetPreference("listtemplate_terme","list_default"); $template = '
{$item->name}
{$labels->definition}:
{$item->definition}
{if count($item->fichiers) > 0}
{$labels->fichiers}:
{foreach from=$item->fichiers item="file"}
{$file->filepath}
({$file->size_wformat})
{/foreach}
{/if} '; $this->SetTemplate("final_default",$template,$this->GetName()); $this->SetPreference("finaltemplate","final_default"); $template = '
{$error_msg}
{if $backlink}
{$backlink}
{/if}'; $this->SetTemplate("no_result",$template,$this->GetName()); // CREATING PERMISSIONS : // permissions $this->CreatePermission("faq_normaluser", "faq: Normal user"); $this->CreatePermission("faq_advanced", "faq: Advanced"); $this->CreatePermission("faq_manage_rubrique", "faq: Manage rubrique"); $this->CreatePermission("faq_manage_terme", "faq: Manage terme"); // activating default preferences $defprefs = array("tabdisplay_rubrique","searchmodule_index_rubrique","tabdisplay_terme","searchmodule_index_terme","restrict_permissions","orderbyname","display_filter","display_instantsearch","display_instantsort","showthumbnails","load_nbchildren","use_session"); foreach($defprefs as $onepref) $this->SetPreference($onepref,true); $this->SetPreference("emptytemplate","**"); // events $this->CreateEvent("faq_added"); $this->CreateEvent("faq_modified"); $this->CreateEvent("faq_deleted"); // prepare information for an eventual upgrade $this->SetPreference("makerversion","1.8.9.3"); // put mention into the admin log $this->Audit( 0, $this->Lang("friendlyname"), $this->Lang("installed",$this->GetVersion())); ?>