<?php

/**
 * Installation handler
 *
 * @package usercategories
 * @version 2.5.2
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 */
defined('COT_CODE') or die('Wrong URL');
global $db_users;
require_once cot_incfile('usercategories', 'plug');
require_once cot_incfile('extrafields');
require_once cot_incfile('structure');
// Add field if missing
if (!$db->fieldExists($db_users, "user_cats")) {
    $dbres = $db->query("ALTER TABLE `{$db_users}` ADD COLUMN `user_cats` TEXT collate utf8_unicode_ci NOT NULL");
}
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'programming', 'structure_title' => 'Программирование', 'structure_path' => '001'));
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'management', 'structure_title' => 'Менеджмент', 'structure_path' => '002'));
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'marketing', 'structure_title' => 'Маркетинг и реклама', 'structure_path' => '003'));
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'design', 'structure_title' => 'Дизайн', 'structure_path' => '004'));
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'seo', 'structure_title' => 'Оптимизация (SEO)', 'structure_path' => '005'));
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'texts', 'structure_title' => 'Тексты', 'structure_path' => '006'));
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'photo', 'structure_title' => 'Фотография', 'structure_path' => '007'));
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'gamedev', 'structure_title' => 'Разработка игр', 'structure_path' => '008'));
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'consulting', 'structure_title' => 'Консалтинг', 'structure_path' => '009'));
cot_structure_add('usercategories', array('structure_area' => 'usercategories', 'structure_code' => 'construction', 'structure_title' => 'Строительство', 'structure_path' => '010'));
 if (!empty($rtplquick)) {
     $rstructure['structure_tpl'] = $rtplquick;
 } elseif ($rtplmode == 3) {
     $rstructure['structure_tpl'] = cot_import('rtplforced', 'P', 'TXT');
 } elseif ($rtplmode == 2) {
     $rstructure['structure_tpl'] = 'same_as_parent';
 } else {
     $rstructure['structure_tpl'] = '';
 }
 /* === Hook === */
 foreach (cot_getextplugins('admin.structure.add.first') as $pl) {
     include $pl;
 }
 /* ===== */
 if (!cot_error_found()) {
     $res = cot_structure_add($n, $rstructure, $is_module);
     if ($res === true) {
         cot_extrafield_movefiles();
         /* === Hook === */
         foreach (cot_getextplugins('admin.structure.add.done') as $pl) {
             include $pl;
         }
         /* ===== */
         cot_message('Added');
     } elseif (is_array($res)) {
         cot_error($res[0], $res[1]);
     } else {
         cot_error('Error');
     }
 }
 cot_redirect(cot_url('admin', 'm=structure&n=' . $n . '&mode=' . $mode . '&d=' . $durl, '', true));
<?php

/**
 * projects module
 *
 * @package projects
 * @version 2.5.5
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 */
defined('COT_CODE') or die('Wrong URL');
require_once cot_incfile('projects', 'module');
require_once cot_incfile('structure');
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'programming', 'structure_title' => 'Программирование', 'structure_path' => '001'));
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'management', 'structure_title' => 'Менеджмент', 'structure_path' => '002'));
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'marketing', 'structure_title' => 'Маркетинг и реклама', 'structure_path' => '003'));
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'design', 'structure_title' => 'Дизайн', 'structure_path' => '004'));
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'seo', 'structure_title' => 'Оптимизация (SEO)', 'structure_path' => '005'));
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'texts', 'structure_title' => 'Тексты', 'structure_path' => '006'));
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'photo', 'structure_title' => 'Фотография', 'structure_path' => '007'));
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'gamedev', 'structure_title' => 'Разработка игр', 'structure_path' => '008'));
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'consulting', 'structure_title' => 'Консалтинг', 'structure_path' => '009'));
cot_structure_add('projects', array('structure_area' => 'projects', 'structure_code' => 'construction', 'structure_title' => 'Строительство', 'structure_path' => '010'));
$db->update($db_auth, array('auth_rights' => 5), "auth_code='projects' AND auth_groupid=4");