first import

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-08 11:40:19 +02:00
commit 1bc61b12ad
8435 changed files with 1582817 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
function publishcontent_update_6001() {
$ret = $node_types = array();
$query = 'SELECT pid, perm FROM {permission}';
$result = db_query($query);
$update_sql = 'UPDATE {permission} SET perm = "%s" WHERE pid = %d';
while ($row = db_fetch_array($result)) {
$old_perm = $row['perm'];
$subjects = array('*all*');
$replacements = array('any');
foreach (node_get_types() as $type) {
$subjects[] = 'publish ' . check_plain($type->type) . ' content';
$subjects[] = 'unpublish ' . check_plain($type->type) . ' content';
$replacements[] = 'publish any ' . check_plain($type->type) . ' content';
$replacements[] = 'unpublish any '. check_plain($type->type) . ' content';
}
$new_perm = str_replace($subjects, $replacements, $row['perm']);
$ret[] = array('success' => db_query($update_sql, $new_perm, $row['pid']), 'query' => t('Updated permission set @set', array('@set' => $row['pid'])));
}
variable_set('menu_rebuild_needed', TRUE);
return $ret;
}