<?php $activeModule = \app::$activeModules; /* Put active module at the top of the list, and remove admin */ unset($activeModule[MODULE]); $activeModule = array_merge(array(MODULE => '1'), $activeModule); unset($activeModule['admin']); $blocksCat = array(); $stylableElements = array(); foreach ($activeModule as $module => $type) { $blocklist = glob('modules/' . $module . '/blocks/*/block.php'); foreach (is_array($blocklist) ? $blocklist : array() as $path) { $blockName = substr(strrchr(substr($path, 0, -10), '/block.php'), 1); if ($blockName !== 'page') { $blockClassName = $module . '\\blocks\\' . $blockName; $reflect = new ReflectionClass('\\' . $blockClassName); $blockInfos = \tools::getClassInfos($reflect); if (isset($blockInfos['block_category'])) { $categBlock = $blockInfos['block_category']; } else { $categBlock = $module; } if (!isset($blocksCat[$categBlock])) { $blocksCat[$categBlock] = ''; } if (isset($blockInfos['description'])) { $description = ucfirst(s($blockInfos['description'])); } $blocksCat[$categBlock] .= '<div class="admin_core_block tooltip" data-title="' . trim(ucfirst(s($blockInfos['title']))) . '" data-tooltip="' . $description . '" draggable="true" id="' . str_replace('\\', '', $blockClassName) . '" data-block="' . $blockClassName . '" style="background:url(' . BASE_PATH . $module . '/blocks/' . $blockName . '/icon.png) center center no-repeat;"></div>'; } /* List default stylables selecteurs */ if (is_file('modules/' . $module . '/blocks/' . $blockName . '/default.css')) {
* @category Parsimony * @package admin * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ app::$response->addJSFile('admin/blocks/modules/block.js', 'footer'); $activeModule = \app::$activeModules; /* Put active module at the top of the list, and remove admin && core modules */ unset($activeModule[MODULE]); $activeModule = array_merge(array(MODULE => '5555'), $activeModule); unset($activeModule['admin']); unset($activeModule['core']); $activeModule['core'] = 0; /* add core(administration tab) module at the end */ foreach ($activeModule as $module => $type) { $moduleobj = \app::getModule($module); $moduleInfos = \tools::getClassInfos($moduleobj); if (!isset($moduleInfos['displayAdmin'])) { $moduleInfos['displayAdmin'] = 3; } $adminHTML = $moduleobj->displayAdmin(); if ($adminHTML === FALSE) { $htmlConfig = ''; } else { $htmlConfig = '<a href="#left_sidebar/settings/' . $module . '" class="configmodule" title="' . t('Administration Module') . ' ' . ucfirst(s($moduleInfos['title'])) . '"></a>'; } if ($moduleInfos['displayAdmin'] > 0) { ?> <div class="moduleTab <?php echo $module === MODULE ? 'active' : ''; ?> " data-module="<?php
} $html .= '<input type="hidden" name="oldName"><input type="submit" class="save_field areaWrite" value="' . t('Save property') . '" style="width: 50%;margin: 5px 0 10px 25%;"></div>'; } } ?> </div> </div> </div> <div id="canvas"> <?php $oldSchema = array(); foreach ($moduleObj->getModel() as $entityName => $entity) { $oldSchema[$entityName] = array(); $reflect = new ReflectionClass('\\' . $module . '\\model\\' . $entityName); $className = $reflect->getShortName(); $modelInfos = \tools::getClassInfos($reflect); $tab = array('name' => $className, 'title' => $entity->getTitle(), 'oldName' => $className, 'behaviorTitle' => $entity->behaviorTitle, 'behaviorDescription' => $entity->behaviorDescription, 'behaviorKeywords' => $entity->behaviorKeywords, 'behaviorImage' => $entity->behaviorImage); echo '<div class="table" data-attributs=\'' . s(json_encode($tab)) . '\' id="table_' . $className . '" style="top:' . $modelInfos['top'] . ';left:' . $modelInfos['left'] . ';"><div class="title">' . $className . '</div>'; $parameters = $entity->getFields(); foreach ($parameters as $propertyName => $field) { $oldSchema[$entityName][$propertyName] = ''; $class = get_class($field); if (isset($aliasClasses[$class])) { $class = $aliasClasses[$class]; } $reflect = new ReflectionClass($field); $params = $reflect->getDefaultProperties(); $args = array(); foreach ($params as $name => $defaultValue) { $args[$name] = $field->{$name}; }