Commit 14fd2f57 authored by anarcat's avatar anarcat Committed by anarcat

#814356 by drewish - fix E_ALL warnings

parent ed92cde2
......@@ -216,10 +216,10 @@ function hosting_client_validate(&$node) {
}
function hosting_client_set_title(&$node) {
if ($node->organization && $node->name) {
if ($node->organization && $node->client_name) {
$node->title = $node->client_name . ' ('.$node->organization.')';
}
elseif ($node->name) {
elseif ($node->client_name) {
$node->title = $node->client_name . ' ('.$node->email.')';
}
elseif ($node->organization) {
......@@ -245,9 +245,11 @@ function hosting_client_insert($node) {
&& !user_load(array('mail' => $node->email))) {
hosting_client_register_user($node);
}
if ($node->new_user) {
if (isset($node->new_user)) {
$user = user_load(array('name' => $node->new_user));
db_query('INSERT INTO {hosting_client_user} (client, user, contact_type) VALUES (%d, %d, "%s")', $node->nid, $user->uid, '');
if ($user) {
db_query('INSERT INTO {hosting_client_user} (client, user, contact_type) VALUES (%d, %d, "%s")', $node->nid, $user->uid, '');
}
}
}
......
......@@ -56,7 +56,7 @@ function _hosting_get_db_servers() {
* Implementation of hook_nodeapi() presave for server node type.
*/
function hosting_db_server_nodeapi_server_presave(&$node) {
if (empty($node->db_passwd) && $node->nid) {
if (empty($node->db_passwd) && !empty($node->nid)) {
$old = node_load($node->nid);
$node->db_passwd = $old->db_passwd;
}
......
......@@ -134,7 +134,7 @@ function hosting_features_form_submit($form, &$form_state) {
function hosting_get_features($refresh = FALSE) {
$cache = cache_get('hosting_features');
if (!$cache->data || $refresh) {
if (empty($cache->data) || $refresh) {
## include any optional hosting.feature.*.inc files
$files = drupal_system_listing("hosting\.feature\.[a-zA-Z_]*\.inc$", "modules");
if (sizeof($files)) {
......@@ -166,7 +166,7 @@ function hosting_feature_node_types($refresh = FALSE) {
if (!is_array($types) || $refresh) {
$features = hosting_get_features($refresh);
foreach ($features as $feature => $info) {
if ($info['node']) {
if (!empty($info['node'])) {
$types[$feature] = $info['node'];
}
}
......
......@@ -192,6 +192,11 @@ function hosting_node_help($type) {
If a task should fail, the administrator will be notified with an explanation of exactly what went wrong,
and how to fix it.");
break;
case 'package' :
return t("<strong>An installable component for a site.</strong>
Hostmaster keeps tracks of all the modules, themes and install profiles installed across your entire network.
These packages most commonly link to their project on drupal.org, but might not in the case of custom modules.
Users are not able to create nodes of this type, as they are generated automatically during verify and sync tasks.");
}
}
......
......@@ -21,6 +21,7 @@ function hosting_package_node_info() {
"type" => 'package', "name" => 'Package',
"module" => 'hosting_package',
"has_title" => FALSE, "title_label" => '',
"description" => hosting_node_help("package"),
"has_body" => 0, "body_label" => '', "min_word_count" => 0);
return $types;
......@@ -29,8 +30,6 @@ function hosting_package_node_info() {
function hosting_package_menu() {
$items = array();
$items['node/%hosting_package_node/packages'] = array(
'title' => 'Packages',
'description' => 'List of packages available for this platform',
......@@ -49,6 +48,7 @@ function hosting_package_menu() {
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -1,
);
$x = 0;
foreach (_hosting_package_types() as $type => $description) {
$items['node/%hosting_package_node/packages/' . $type] = array(
'title' => $description,
......
......@@ -10,7 +10,7 @@ function hosting_task_menu() {
$items = array();
foreach (array('site', 'platform') as $type) {
foreach (hosting_available_tasks($type) as $task => $info) {
if (!$info['hidden']) {
if (empty($info['hidden'])) {
$path = sprintf("node/%%hosting_task_%s/%s_%s", $type, $type, $task);
$items[$path] = array(
'title' => $info['title'],
......@@ -152,7 +152,7 @@ function hosting_task_node_info() {
"type" => 'task', "name" => 'Task',
"module" => 'hosting_task',
"has_title" => FALSE, "title_label" => '',
# "description" => hosting_node_help("task"),
"description" => hosting_node_help("task"),
"has_body" => 0, "body_label" => '', "min_word_count" => 0);
return $types;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment