Skip to content

Commit

Permalink
Minor changes to Drupal module.
Browse files Browse the repository at this point in the history
Changed layout of archive file, removed stray directory, made some minor changes to the help text, and renamed a few variables.
  • Loading branch information
Mark Birbeck authored and Mark Birbeck committed Jan 16, 2010
1 parent e46d4b4 commit 41f3b3e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
14 changes: 7 additions & 7 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@

<target name="create-drupal-package" depends="-init">
<mkdir dir="${deploy.root.dir}/drupal" />
<mkdir dir="${drupal.output.dir}" />

<zip destfile="${deploy.root.dir}/drupal/${drupal.package.name}">
<fileset dir="${drupal.dir}">
<include name="**/*" />
</fileset>
</zip>
<tar destfile="${drupal.output.dir}/${drupal.package.name}.tar">
<tarfileset dir="${drupal.dir}" prefix="${drupal.package.name}/" preserveLeadingSlashes="true" />
</tar>
<gzip destfile="${deploy.root.dir}/drupal/${drupal.package.name}.tar.gz" src="${drupal.output.dir}/${drupal.package.name}.tar"/>
</target>

<target name="release-drupal" depends="-init, create-drupal-package">
Expand All @@ -317,8 +317,8 @@
username="${gc.username}"
password="${gc.password}"
projectname="${project.name}"
filename="${deploy.root.dir}/drupal/${drupal.package.name}"
targetfilename="${drupal.package.name}"
filename="${deploy.root.dir}/drupal/${drupal.package.name}.tar.gz"
targetfilename="${drupal.package.name}.tar.gz"
summary="${project.name} Drupal module, version ${drupal.version.number}"
labels="Type-Archive, OpSys-All"
/>
Expand Down
5 changes: 3 additions & 2 deletions drupal.ant.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
drupal.version.number = 1.0.1
drupal.package.name = ${project.name}-drupal-${drupal.version.number}.zip
drupal.version.number = 1.0.2
drupal.package.name = ${project.name}-drupal-${drupal.version.number}
drupal.dir = ${src.dir}/drupal
drupal.output.dir = ${build.dir}/output/${drupal.package.name}
14 changes: 7 additions & 7 deletions drupal/backplanejs.module
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function backplanejs_form_alter(&$form, $form_state, $form_id) {
'#type' => 'fieldset',
'#title' => t('backplanejs libraries'),
'#tree' => TRUE,
'#description' => t('Choose which, if any, of the listed backplanejs versions should be loaded when this node is viewed. If you have already associated one or more libraries and wish to disassociate them, just select the blank value from the dropdown and \'Save\' the node.'),
'#description' => t('Choose which, if any, of the listed libraries should be loaded when this node is viewed. If you have already associated one or more libraries and wish to disassociate them, just select the blank value from the dropdown and \'Save\' the node.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#weight' => 100,
Expand Down Expand Up @@ -445,14 +445,14 @@ function _backplanejs_library_version_delete_form_validate($form, &$form_state)
function _backplanejs_library_version_delete_form_submit($form, &$form_state) {
// Remove the library version, any node association and any node_type association with library version
// $k = backplanejs_script_lib_ver.id, $v =, if checkbox selected, same as $k. If unselected value is '0'.
foreach ($form_state['values']['delete-versions'] as $k => $v) {
foreach ($form_state['values']['delete-versions'] as $id => $v) {
if ($v > 0) {
db_query(
"DELETE slv.*, nsl.*, ntsl.* FROM {backplanejs_script_lib_ver} slv LEFT JOIN {backplanejs_node_script_lib} nsl ON slv.id = nsl.lib_ver_id LEFT JOIN {backplanejs_node_type_script_lib} ntsl ON slv.id = ntsl.lib_ver_id WHERE slv.id = %d",
$k
$id
);

watchdog(MODULE_NAME, t('Deleted library version and association(s). Lib ver id: !slvid', array('!slvid' => $k)));
watchdog(MODULE_NAME, t('Deleted library version and association(s). Lib ver id: !slvid', array('!slvid' => $id)));
}
}
drupal_set_message(t('Library version(s) and any node/node type associations deleted.'));
Expand Down Expand Up @@ -815,7 +815,7 @@ function _backplanejs_node_type_form_submit($form, &$form_state) {
// Compare the 'op' to the values of the 'submit' and 'delete' siblings to work out what's going on?
// <home>/modules/node/content_types.inc just uses the t()'d button text.
if($action == t('Save content type')) {
foreach($libs as $k => $lvid) {
foreach($libs as $id => $lvid) {
if($lvid > 0) {
db_query(
"INSERT INTO {backplanejs_node_type_script_lib} (lib_ver_id, node_type) VALUES (%d, '%s')",
Expand Down Expand Up @@ -877,14 +877,14 @@ function _backplanejs_delete_node_script_libs($node_id = 0, $vid = 0, $all_revis
function _backplanejs_insert_node_script_libs($node_id = 0, $vid = 0, $libs = array()) {
if ($node_id > 0) {
// Could this be done more efficiently as one SQL statement?
foreach ($libs as $k => $v) {
foreach ($libs as $id => $v) {
// Value of 0 is empty. No lib version selected
if ($v > 0) {
db_query(
"INSERT INTO {backplanejs_node_script_lib} (nid, vid, lib_ver_id) VALUES (%d, %d, %d)",
$node_id,
$vid,
$v
$id
);
}
}
Expand Down

0 comments on commit 41f3b3e

Please sign in to comment.