# HG changeset patch # User Franck Deroche # Date 1253279933 -7200 # Node ID 50a57b1517cbcdcbd23da068fc731b4b7c9e4533 # Parent 842d89897cb4690088dbf001854302375ec5019b Fully working MEE, with Ressource Manager & all diff -r 842d89897cb4 -r 50a57b1517cb css/mee.css --- a/css/mee.css Mon Jun 08 18:33:19 2009 +0200 +++ b/css/mee.css Fri Sep 18 15:18:53 2009 +0200 @@ -2,10 +2,10 @@ float: left; width: 100%; } -.mee-wrap-editor-library .form-item, table.mee-ressource-manager, .mee-filter-form { +.mee-wrap-editor-library .form-item, table.mee-ressource-manager, .mee-filter-form, .dnd-fields-wrapper { width: 73%; } -.mee-filter-form .form-item { +.mee-filter-form .form-item, .mee-wrap-editor-library .dnd-fields-wrapper { width: 100%; } .mee-filter-form .form-item .tips li { @@ -22,7 +22,7 @@ display: inline; white-space: normal; } -.mee-wrap-editor-library .dnd-library-wrapper { +.dnd-library-wrapper { float: right; width: 25%; } @@ -170,6 +170,15 @@ font-size: .875em; margin-bottom: .5em; } +.sdl-preview-item dt { + font-weight: bold; +} +.sdl-preview-item dd { + margin-left: 1em; +} +.sdl-preview-item div.image { + float: left; +} /* Fix for Garland */ #center .dnd-library-wrapper form { margin: 0; diff -r 842d89897cb4 -r 50a57b1517cb mee.install --- a/mee.install Mon Jun 08 18:33:19 2009 +0200 +++ b/mee.install Fri Sep 18 15:18:53 2009 +0200 @@ -8,6 +8,7 @@ function mee_install() { drupal_load('module', 'content'); content_notify('install', 'mee'); + drupal_install_schema('mee'); } /** @@ -16,6 +17,7 @@ function mee_uninstall() { drupal_load('module', 'content'); content_notify('uninstall', 'mee'); + drupal_uninstall_schema('mee'); } /** @@ -25,3 +27,36 @@ drupal_load('module', 'content'); content_notify('disable', 'mee'); } + +/** + * Add separate column for the required status + */ +function mee_update_6001() { + $ret = array(); + switch ($GLOBALS['db_type']) { + case 'mysql': + case 'mysqli': + $ret[] = update_sql("ALTER TABLE {mee_ressources} ADD required INT NOT NULL DEFAULT 0"); + break; + } + return $ret; +} + + +/** + * Implementation of hook_schema(). + */ + function mee_schema() { + $schema['mee_ressources'] = array( + 'fields' => array( + 'content_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'atom_sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'field' => array('type' => 'varchar', 'length' => 31, 'not null' => TRUE, 'default' => ''), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'required' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + ), + 'primary key' => array('content_nid', 'atom_sid'), + ); + + return $schema; + } diff -r 842d89897cb4 -r 50a57b1517cb mee.js --- a/mee.js Mon Jun 08 18:33:19 2009 +0200 +++ b/mee.js Fri Sep 18 15:18:53 2009 +0200 @@ -26,7 +26,8 @@ .find('table.mee-ressource-manager') .each(function(i) { $(this).append(Drupal.mee.generate( - rep.title, + data.representation_id, + rep, Drupal.tableDrag[this.id] )); }); @@ -37,17 +38,29 @@ detach: function(e, data) { }, - generate: function(title, tableDrag) { - var $select = $(""), $tr = $(''), $td = $(""), parity; + var separator = $(tableDrag.table).find('div.mee-rm-separator select')[0]; + var wn = separator.name.replace(/\[0\]\[weight\]$/, '[' + id +'][weight]'); + var $required = $("