Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

324
 
331
 
331
 
modules.php
_> 1818         $_content,
  1919         $_author_name,
  2020         $_author_www,
<> 21 -        $_keys;
   21+        $_keys,
   22+        $_module_group;
2223 
<> 23 -    function osC_Boxes() {
   24+    function osC_Boxes($module_group) {
   25+      $this->_module_group = $module_group;
   26+
2427       global $osC_Database, $osC_Template, $osC_Cache;
  2528 
<> 26 -      if ($osC_Cache->read('templates_boxes_layout-' . $osC_Template->getTemplate() . '-' . $osC_Template->getGroup() . '-' . $osC_Template->getPageContentsFilename())) {
   29+      if ($osC_Cache->read('templates_' . $this->_module_group . '_layout-' . $osC_Template->getTemplate() . '-' . $osC_Template->getGroup() . '-' . $osC_Template->getPageContentsFilename())) {
2730         $data = $osC_Cache->getCache();
  2831       } else {
  2932         $data = array();
  3033 
<> 31 -        $Qspecific = $osC_Database->query('select b2p.boxes_group, b.code from :table_templates_boxes_to_pages b2p, :table_templates_boxes b, :table_templates t where b2p.templates_id = :templates_id and b2p.page_specific = 1 and b2p.content_page in (:content_page) and b2p.templates_boxes_id = b.id and b2p.templates_id = t.id order by b2p.boxes_group, b2p.sort_order');
   34+        $Qspecific = $osC_Database->query('select b2p.boxes_group, b.code from :table_templates_boxes_to_pages b2p, :table_templates_boxes b, :table_templates t where b2p.templates_id = :templates_id and b2p.page_specific = 1 and b2p.content_page in (:content_page) and b2p.templates_boxes_id = b.id and b.modules_group = :modules_group and b2p.templates_id = t.id order by b2p.boxes_group, b2p.sort_order');
3235         $Qspecific->bindTable(':table_templates_boxes_to_pages', TABLE_TEMPLATES_BOXES_TO_PAGES);
  3336         $Qspecific->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  3437         $Qspecific->bindTable(':table_templates', TABLE_TEMPLATES);
  3538         $Qspecific->bindInt(':templates_id', 1);
  3639         $Qspecific->bindRaw(':content_page', '"*", "' . $osC_Template->getGroup() . '/*", "' . $osC_Template->getGroup() . '/' . substr($osC_Template->getPageContentsFilename(), 0, strrpos($osC_Template->getPageContentsFilename(), '.')) . '"');
<>  40+        $Qspecific->bindValue(':modules_group', $this->_module_group);
3741         $Qspecific->execute();
  3842 
  3943         if ($Qspecific->numberOfRows()) {
  4044           while ($Qspecific->next()) {
  4145             $data[$Qspecific->value('boxes_group')][] = $Qspecific->value('code');
  4246           }
  4347         } else {
<> 44 -          $Qboxes = $osC_Database->query('select b2p.boxes_group, b2p.content_page, b.code from :table_templates_boxes_to_pages b2p, :table_templates_boxes b, :table_templates t where b2p.templates_id = :templates_id and b2p.content_page in (:content_page) and b2p.templates_boxes_id = b.id and b2p.templates_id = t.id order by b2p.boxes_group, b2p.sort_order');
   48+          $Qboxes = $osC_Database->query('select b2p.boxes_group, b2p.content_page, b.code from :table_templates_boxes_to_pages b2p, :table_templates_boxes b, :table_templates t where b2p.templates_id = :templates_id and b2p.content_page in (:content_page) and b2p.templates_boxes_id = b.id and b.modules_group = :modules_group and b2p.templates_id = t.id order by b2p.boxes_group, b2p.sort_order');
4549           $Qboxes->bindTable(':table_templates_boxes_to_pages', TABLE_TEMPLATES_BOXES_TO_PAGES);
  4650           $Qboxes->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  4751           $Qboxes->bindTable(':table_templates', TABLE_TEMPLATES);
  4852           $Qboxes->bindInt(':templates_id', 1);
  4953           $Qboxes->bindRaw(':content_page', '"*", "' . $osC_Template->getGroup() . '/*", "' . $osC_Template->getGroup() . '/' . substr($osC_Template->getPageContentsFilename(), 0, strrpos($osC_Template->getPageContentsFilename(), '.')) . '"');
<>  54+          $Qboxes->bindValue(':modules_group', $this->_module_group);
5055           $Qboxes->execute();
  5156 
  5257           while ($Qboxes->next()) {
     
 !
112117 
  113118       if (isset($this->_boxes[$group])) {
  114119         foreach ($this->_boxes[$group] as $box) {
<> 115 -          if (file_exists('includes/boxes/' . $box . '.php')) {
  116 -            $box_class = 'osC_Boxes_' . $box;
   120+          if (file_exists('includes/modules/' . $this->_module_group . '/' . $box . '.php')) {
   121+            $box_class = 'osC_' . ucfirst($this->_module_group) . '_' . $box;
117122 
  118123             if (class_exists($box_class) === false) {
<> 119 -              include('includes/boxes/' . $box . '.php');
   124+              include('includes/modules/' . $this->_module_group . '/' . $box . '.php');
120125             }
  121126 
  122127             $boxes[] = $box_class;
     
 !
133138       static $is_installed;
  134139 
  135140       if (isset($is_installed) === false) {
<> 136 -        $Qcheck = $osC_Database->query('select id from :table_templates_boxes where code = :code');
   141+        $Qcheck = $osC_Database->query('select id from :table_templates_boxes where code = :code and modules_group = :modules_group');
137142         $Qcheck->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  138143         $Qcheck->bindValue(':code', $this->_code);
<>  144+        $Qcheck->bindValue(':modules_group', $this->_module_group);
139145         $Qcheck->execute();
  140146 
  141147         $is_installed = ($Qcheck->numberOfRows()) ? true : false;
     
 !
169175     function remove() {
  170176       global $osC_Database;
  171177 
<> 172 -      $Qbox = $osC_Database->query('select id from :table_templates_boxes where code = :code');
   178+      $Qbox = $osC_Database->query('select id from :table_templates_boxes where code = :code and modules_group = :modules_group');
173179       $Qbox->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  174180       $Qbox->bindValue(':code', $this->_code);
<>  181+      $Qbox->bindValue(':modules_group', $this->_module_group);
175182       $Qbox->execute();
  176183 
  177184       $Qdel = $osC_Database->query('delete from :table_templates_boxes_to_pages where templates_boxes_id = :templates_boxes_id');
  178185       $Qdel->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  179186       $Qdel->bindValue(':templates_boxes_id', $Qbox->valueInt('id'));
  180187       $Qdel->execute();
  181188 
<> 182 -      $Qdel = $osC_Database->query('delete from :table_templates_boxes where code = :code');
   189+      $Qdel = $osC_Database->query('delete from :table_templates_boxes where code = :code and modules_group = :modules_group');
183190       $Qdel->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  184191       $Qdel->bindValue(':code', $this->_code);
<>  192+      $Qdel->bindValue(':modules_group', $this->_module_group);
<_ 185193       $Qdel->execute();
  186194 
  187195       if ($this->hasKeys()) {