Skip to content
Snippets Groups Projects
Commit 7c7a8953 authored by l26yan's avatar l26yan
Browse files

fix #271727

parents
No related branches found
No related tags found
No related merge requests found
.content_node .field-items {
padding-bottom: 3px !important;
}
.field-name-field-project-name .field-items {
float: left;
margin-right: 1em;
}
.field-name-field-project-roles .field-items {
float: left;
position:absolute;
margin-left: 14.5em;
}
div.view-uw-project-views div.view-content div.views-row {
margin-bottom: 0.5em;
}
div.view .project-title {
border: medium none;
font-size: 1.1em;
font-weight: normal;
margin-bottom: 0.2em;
margin-top: 0.6em;
}
div.item-list div.view-all-topics {
margin-left: 10em;
margin-bottom: 0.5em;
}
\ No newline at end of file
<?php
/**
* @file
* uw_ct_project.context.inc
*/
/**
* Implements hook_context_default_contexts().
*/
function uw_ct_project_context_default_contexts() {
$export = array();
$context = new stdClass();
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'uw_project';
$context->description = 'Displays projects by status, audience and topic';
$context->tag = 'Content';
$context->conditions = array(
'path' => array(
'values' => array(
'projects' => 'projects',
'projects/*' => 'projects/*',
'all_current_projects' => 'all_current_projects',
'all_other_initiatives' => 'all_other_initiatives',
'all_proposed_projects' => 'all_proposed_projects',
'all_completed_projects' => 'all_completed_projects',
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
'uw_ct_project-project_by_status' => array(
'module' => 'uw_ct_project',
'delta' => 'project_by_status',
'region' => 'sidebar_second',
'weight' => '-11',
),
'views-9e98baf6edb027f74ebfcf0ab833610e' => array(
'module' => 'views',
'delta' => '9e98baf6edb027f74ebfcf0ab833610e',
'region' => 'sidebar_second',
'weight' => '-9',
),
'uw_ct_project-project_by_topic' => array(
'module' => 'uw_ct_project',
'delta' => 'project_by_topic',
'region' => 'sidebar_second',
'weight' => '-10',
),
),
),
);
$context->condition_mode = 0;
// Translatables
// Included for use with string extractors like potx.
t('Content');
t('Displays projects by status, audience and topic');
$export['uw_project'] = $context;
$context = new stdClass();
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'uw_project-graduate_page';
$context->description = 'Displays projects relevant to Graduate Students';
$context->tag = 'Content';
$context->conditions = array(
'path' => array(
'values' => array(
'graduate-students' => 'graduate-students',
'graduate-students/*' => 'graduate-students/*',
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
'views-5de6321df96e1840260b5c8bc976bdab' => array(
'module' => 'views',
'delta' => '5de6321df96e1840260b5c8bc976bdab',
'region' => 'content',
'weight' => '2',
),
),
),
);
$context->condition_mode = 0;
// Translatables
// Included for use with string extractors like potx.
t('Content');
t('Displays projects relevant to Graduate Students');
$export['uw_project-graduate_page'] = $context;
$context = new stdClass();
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'uw_project-instructors-page';
$context->description = 'Displays projects relevant to Instructors';
$context->tag = 'Content';
$context->conditions = array(
'path' => array(
'values' => array(
'instructors' => 'instructors',
'instructors/*' => 'instructors/*',
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
'views-a57af583555eadcb7a1366fcc8afdb0a' => array(
'module' => 'views',
'delta' => 'a57af583555eadcb7a1366fcc8afdb0a',
'region' => 'content',
'weight' => '2',
),
),
),
);
$context->condition_mode = 0;
// Translatables
// Included for use with string extractors like potx.
t('Content');
t('Displays projects relevant to Instructors');
$export['uw_project-instructors-page'] = $context;
$context = new stdClass();
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'uw_project-researchers_page';
$context->description = 'Displays projects relevant to Researchers';
$context->tag = 'Content';
$context->conditions = array(
'path' => array(
'values' => array(
'researchers' => 'researchers',
'researchers/*' => 'researchers/*',
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
'views-e93ce64287c8e90cb286421fd979c01d' => array(
'module' => 'views',
'delta' => 'e93ce64287c8e90cb286421fd979c01d',
'region' => 'content',
'weight' => '2',
),
),
),
);
$context->condition_mode = 0;
// Translatables
// Included for use with string extractors like potx.
t('Content');
t('Displays projects relevant to Researchers');
$export['uw_project-researchers_page'] = $context;
$context = new stdClass();
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'uw_project-seeking_page';
$context->description = 'Displays projects relevant to Staff Seeking IT Support';
$context->tag = 'Content';
$context->conditions = array(
'path' => array(
'values' => array(
'staff-seeking-it-support' => 'staff-seeking-it-support',
'staff-seeking-it-support/*' => 'staff-seeking-it-support/*',
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
'views-67d28498b92d93e2c45db78fdac08768' => array(
'module' => 'views',
'delta' => '67d28498b92d93e2c45db78fdac08768',
'region' => 'content',
'weight' => '2',
),
),
),
);
$context->condition_mode = 0;
// Translatables
// Included for use with string extractors like potx.
t('Content');
t('Displays projects relevant to Staff Seeking IT Support');
$export['uw_project-seeking_page'] = $context;
$context = new stdClass();
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'uw_project-support_page';
$context->description = 'Displays projects relevant to IT Support Staff';
$context->tag = 'Content';
$context->conditions = array(
'path' => array(
'values' => array(
'it-support-staff' => 'it-support-staff',
'it-support-staff/*' => 'it-support-staff/*',
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
'views-264353462f2c1146bd6bfcd79b7affd3' => array(
'module' => 'views',
'delta' => '264353462f2c1146bd6bfcd79b7affd3',
'region' => 'content',
'weight' => '2',
),
),
),
);
$context->condition_mode = 0;
// Translatables
// Included for use with string extractors like potx.
t('Content');
t('Displays projects relevant to IT Support Staff');
$export['uw_project-support_page'] = $context;
$context = new stdClass();
$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'uw_project-undergraduate_page';
$context->description = 'Displays projects relevant to Undergraduate Students';
$context->tag = 'Content';
$context->conditions = array(
'path' => array(
'values' => array(
'undergraduate-students' => 'undergraduate-students',
'undergraduate-students/*' => 'undergraduate-students/*',
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
'views-58647c4215bb33bd7fbe642b229ce619' => array(
'module' => 'views',
'delta' => '58647c4215bb33bd7fbe642b229ce619',
'region' => 'content',
'weight' => '2',
),
),
),
);
$context->condition_mode = 0;
// Translatables
// Included for use with string extractors like potx.
t('Content');
t('Displays projects relevant to Undergraduate Students');
$export['uw_project-undergraduate_page'] = $context;
return $export;
}
This diff is collapsed.
<?php
/**
* @file
* uw_ct_project.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function uw_ct_project_ctools_plugin_api() {
list($module, $api) = func_get_args();
if ($module == "context" && $api == "context") {
return array("version" => "3");
}
list($module, $api) = func_get_args();
if ($module == "field_group" && $api == "field_group") {
return array("version" => "1");
}
list($module, $api) = func_get_args();
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
}
/**
* Implements hook_views_api().
*/
function uw_ct_project_views_api() {
return array("version" => "3.0");
}
/**
* Implements hook_node_info().
*/
function uw_ct_project_node_info() {
$items = array(
'uw_project' => array(
'name' => t('Project'),
'base' => 'node_content',
'description' => t('Project offered at the University of Waterloo'),
'has_title' => '1',
'title_label' => t('Title'),
'help' => '',
),
);
return $items;
}
<?php
/**
* @file
* uw_ct_project.features.menu_links.inc
*/
/**
* Implements hook_menu_default_menu_links().
*/
function uw_ct_project_menu_default_menu_links() {
$menu_links = array();
// Exported menu link: main-menu:projects
$menu_links['main-menu:projects'] = array(
'menu_name' => 'main-menu',
'link_path' => 'projects',
'router_path' => 'projects',
'link_title' => 'Projects',
'options' => array(),
'module' => 'system',
'hidden' => '0',
'external' => '0',
'has_children' => '1',
'expanded' => '0',
'weight' => '0',
);
// Exported menu link: main-menu:projects/all_completed_projects
$menu_links['main-menu:projects/all_completed_projects'] = array(
'menu_name' => 'main-menu',
'link_path' => 'projects/all_completed_projects',
'router_path' => 'projects/all_completed_projects',
'link_title' => 'All completed projects',
'options' => array(
'attributes' => array(
'title' => '',
),
),
'module' => 'menu',
'hidden' => '1',
'external' => '0',
'has_children' => '0',
'expanded' => '0',
'weight' => '-41',
'parent_path' => 'projects',
);
// Exported menu link: main-menu:projects/all_current_projects
$menu_links['main-menu:projects/all_current_projects'] = array(
'menu_name' => 'main-menu',
'link_path' => 'projects/all_current_projects',
'router_path' => 'projects/all_current_projects',
'link_title' => 'All current projects',
'options' => array(
'attributes' => array(
'title' => '',
),
),
'module' => 'menu',
'hidden' => '1',
'external' => '0',
'has_children' => '0',
'expanded' => '0',
'weight' => '-44',
'parent_path' => 'projects',
);
// Exported menu link: main-menu:projects/all_other_initiatives
$menu_links['main-menu:projects/all_other_initiatives'] = array(
'menu_name' => 'main-menu',
'link_path' => 'projects/all_other_initiatives',
'router_path' => 'projects/all_other_initiatives',
'link_title' => 'All other initiatives',
'options' => array(
'attributes' => array(
'title' => '',
),
),
'module' => 'menu',
'hidden' => '1',
'external' => '0',
'has_children' => '0',
'expanded' => '0',
'weight' => '-43',
'parent_path' => 'projects',
);
// Exported menu link: main-menu:projects/all_proposed_projects
$menu_links['main-menu:projects/all_proposed_projects'] = array(
'menu_name' => 'main-menu',
'link_path' => 'projects/all_proposed_projects',
'router_path' => 'projects/all_proposed_projects',
'link_title' => 'All proposed projects',
'options' => array(
'attributes' => array(
'title' => '',
),
),
'module' => 'menu',
'hidden' => '1',
'external' => '0',
'has_children' => '0',
'expanded' => '0',
'weight' => '-42',
'parent_path' => 'projects',
);
// Exported menu link: main-menu:projects/audience
$menu_links['main-menu:projects/audience'] = array(
'menu_name' => 'main-menu',
'link_path' => 'projects/audience',
'router_path' => 'projects/audience',
'link_title' => 'Projects by audience',
'options' => array(
'attributes' => array(
'title' => '',
),
),
'module' => 'menu',
'hidden' => '1',
'external' => '0',
'has_children' => '0',
'expanded' => '0',
'weight' => '-45',
'parent_path' => 'projects',
);
// Exported menu link: main-menu:projects/projects-by-topic
$menu_links['main-menu:projects/projects-by-topic'] = array(
'menu_name' => 'main-menu',
'link_path' => 'projects/projects-by-topic',
'router_path' => 'projects/projects-by-topic',
'link_title' => 'Projects by topic',
'options' => array(
'attributes' => array(
'title' => '',
),
),
'module' => 'menu',
'hidden' => '1',
'external' => '0',
'has_children' => '0',
'expanded' => '0',
'weight' => '-47',
'parent_path' => 'projects',
);
// Exported menu link: main-menu:projects/topic
$menu_links['main-menu:projects/topic'] = array(
'menu_name' => 'main-menu',
'link_path' => 'projects/topic',
'router_path' => 'projects/topic',
'link_title' => 'Projects by individual topic',
'options' => array(
'attributes' => array(
'title' => '',
),
),
'module' => 'menu',
'hidden' => '1',
'external' => '0',
'has_children' => '0',
'expanded' => '0',
'weight' => '-46',
'parent_path' => 'projects',
);
// Translatables
// Included for use with string extractors like potx.
t('All completed projects');
t('All current projects');
t('All other initiatives');
t('All proposed projects');
t('Projects');
t('Projects by audience');
t('Projects by individual topic');
t('Projects by topic');
return $menu_links;
}
<?php
/**
* @file
* uw_ct_project.features.user_permission.inc
*/
/**
* Implements hook_user_default_permissions().
*/
function uw_ct_project_user_default_permissions() {
$permissions = array();
// Exported permission: create uw_project content.
$permissions['create uw_project content'] = array(
'name' => 'create uw_project content',
'roles' => array(
0 => 'administrator',
1 => 'content author',
2 => 'content editor',
3 => 'site manager',
),
'module' => 'node',
);
// Exported permission: delete any uw_project content.
$permissions['delete any uw_project content'] = array(
'name' => 'delete any uw_project content',
'roles' => array(
0 => 'administrator',
1 => 'content editor',
2 => 'site manager',
),
'module' => 'node',
);
// Exported permission: delete own uw_project content.
$permissions['delete own uw_project content'] = array(
'name' => 'delete own uw_project content',
'roles' => array(
0 => 'administrator',
1 => 'content editor',
2 => 'site manager',
),
'module' => 'node',
);
// Exported permission: edit any uw_project content.
$permissions['edit any uw_project content'] = array(
'name' => 'edit any uw_project content',
'roles' => array(
0 => 'administrator',
1 => 'content author',
2 => 'content editor',
3 => 'site manager',
),
'module' => 'node',
);
// Exported permission: edit own uw_project content.
$permissions['edit own uw_project content'] = array(
'name' => 'edit own uw_project content',
'roles' => array(
0 => 'administrator',
1 => 'content author',
2 => 'content editor',
3 => 'site manager',
),
'module' => 'node',
);
// Exported permission: enter uw_project revision log entry.
$permissions['enter uw_project revision log entry'] = array(
'name' => 'enter uw_project revision log entry',
'roles' => array(
0 => 'administrator',
),
'module' => 'override_node_options',
);
// Exported permission: override uw_project authored by option.
$permissions['override uw_project authored by option'] = array(
'name' => 'override uw_project authored by option',
'roles' => array(
0 => 'administrator',
),
'module' => 'override_node_options',
);
// Exported permission: override uw_project authored on option.
$permissions['override uw_project authored on option'] = array(
'name' => 'override uw_project authored on option',
'roles' => array(
0 => 'administrator',
),
'module' => 'override_node_options',
);
// Exported permission: override uw_project promote to front page option.
$permissions['override uw_project promote to front page option'] = array(
'name' => 'override uw_project promote to front page option',
'roles' => array(
0 => 'administrator',
),
'module' => 'override_node_options',
);
// Exported permission: override uw_project published option.
$permissions['override uw_project published option'] = array(
'name' => 'override uw_project published option',
'roles' => array(
0 => 'administrator',
),
'module' => 'override_node_options',
);
// Exported permission: override uw_project revision option.
$permissions['override uw_project revision option'] = array(
'name' => 'override uw_project revision option',
'roles' => array(
0 => 'administrator',
),
'module' => 'override_node_options',
);
// Exported permission: override uw_project sticky option.
$permissions['override uw_project sticky option'] = array(
'name' => 'override uw_project sticky option',
'roles' => array(
0 => 'administrator',
),
'module' => 'override_node_options',
);
return $permissions;
}
<?php
/**
* @file
* uw_ct_project.field_group.inc
*/
/**
* Implements hook_field_group_info().
*/
function uw_ct_project_field_group_info() {
$export = array();
$field_group = new stdClass();
$field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
$field_group->api_version = 1;
$field_group->identifier = 'group_upload_file|node|uw_project|form';
$field_group->group_name = 'group_upload_file';
$field_group->entity_type = 'node';
$field_group->bundle = 'uw_project';
$field_group->mode = 'form';
$field_group->parent_name = '';
$field_group->data = array(
'label' => 'Upload a file',
'weight' => '4',
'children' => array(
0 => 'field_file',
),
'format_type' => 'fieldset',
'format_settings' => array(
'label' => 'Upload a file',
'instance_settings' => array(
'required_fields' => 1,
'classes' => '',
'description' => '',
),
'formatter' => 'collapsed',
),
);
$export['group_upload_file|node|uw_project|form'] = $field_group;
$field_group = new stdClass();
$field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
$field_group->api_version = 1;
$field_group->identifier = 'group_upload_image|node|uw_project|form';
$field_group->group_name = 'group_upload_image';
$field_group->entity_type = 'node';
$field_group->bundle = 'uw_project';
$field_group->mode = 'form';
$field_group->parent_name = '';
$field_group->data = array(
'label' => 'Upload an image',
'weight' => '3',
'children' => array(
0 => 'field_image',
),
'format_type' => 'fieldset',
'format_settings' => array(
'label' => 'Upload an image',
'instance_settings' => array(
'required_fields' => 1,
'classes' => '',
'description' => '',
),
'formatter' => 'collapsed',
),
);
$export['group_upload_image|node|uw_project|form'] = $field_group;
return $export;
}
name = Project
description = Project content type
core = 7.x
package = uWaterloo Content Types
php = 5.2.4
version = 7.x-1.1.9
project = uw_ct_project
dependencies[] = context
dependencies[] = ctools
dependencies[] = entityreference
dependencies[] = features
dependencies[] = field_collection
dependencies[] = field_group
dependencies[] = image
dependencies[] = link
dependencies[] = list
dependencies[] = node_reference
dependencies[] = options
dependencies[] = override_node_options
dependencies[] = strongarm
dependencies[] = taxonomy
dependencies[] = uw_vocab_term_lock
dependencies[] = uw_nav_main_menu
dependencies[] = views
features[context][] = uw_project
features[context][] = uw_project-graduate_page
features[context][] = uw_project-instructors-page
features[context][] = uw_project-researchers_page
features[context][] = uw_project-seeking_page
features[context][] = uw_project-support_page
features[context][] = uw_project-undergraduate_page
features[ctools][] = context:context:3
features[ctools][] = field_group:field_group:1
features[ctools][] = strongarm:strongarm:1
features[ctools][] = views:views_default:3.0
features[features_api][] = api:1
features[field][] = field_collection_item-field_project_leaderrole-field_project_name
features[field][] = field_collection_item-field_project_leaderrole-field_project_roles
features[field][] = node-uw_project-field_file
features[field][] = node-uw_project-field_image
features[field][] = node-uw_project-field_project_audience
features[field][] = node-uw_project-field_project_description
features[field][] = node-uw_project-field_project_leaderrole
features[field][] = node-uw_project-field_project_status
features[field][] = node-uw_project-field_project_topic
features[field_group][] = group_upload_file|node|uw_project|form
features[field_group][] = group_upload_image|node|uw_project|form
features[menu_links][] = main-menu:projects
features[menu_links][] = main-menu:projects/all_completed_projects
features[menu_links][] = main-menu:projects/all_current_projects
features[menu_links][] = main-menu:projects/all_other_initiatives
features[menu_links][] = main-menu:projects/all_proposed_projects
features[menu_links][] = main-menu:projects/audience
features[menu_links][] = main-menu:projects/projects-by-topic
features[menu_links][] = main-menu:projects/topic
features[node][] = uw_project
features[user_permission][] = create uw_project content
features[user_permission][] = delete any uw_project content
features[user_permission][] = delete own uw_project content
features[user_permission][] = edit any uw_project content
features[user_permission][] = edit own uw_project content
features[user_permission][] = enter uw_project revision log entry
features[user_permission][] = override uw_project authored by option
features[user_permission][] = override uw_project authored on option
features[user_permission][] = override uw_project promote to front page option
features[user_permission][] = override uw_project published option
features[user_permission][] = override uw_project revision option
features[user_permission][] = override uw_project sticky option
features[variable][] = additional_settings__active_tab_uw_project
features[variable][] = enable_revisions_page_uw_project
features[variable][] = field_bundle_settings_node__uw_project
features[variable][] = mb_content_cancel_uw_project
features[variable][] = mb_content_sac_uw_project
features[variable][] = mb_content_tabcn_uw_project
features[variable][] = menu_options_uw_project
features[variable][] = menu_parent_uw_project
features[variable][] = node_options_uw_project
features[variable][] = node_preview_uw_project
features[variable][] = node_submitted_uw_project
features[variable][] = pathauto_node_uw_project_pattern
features[variable][] = pathauto_taxonomy_term_pattern
features[variable][] = pathauto_taxonomy_term_project_audience_pattern
features[variable][] = pathauto_taxonomy_term_project_status_pattern
features[variable][] = pathauto_taxonomy_term_project_topic_pattern
features[variable][] = pathauto_taxonomy_term_uwaterloo_audience_pattern
features[variable][] = save_continue_project
features[variable][] = schemaorg_type_uw_project
features[variable][] = show_diff_inline_uw_project
features[variable][] = show_preview_changes_uw_project
features[variable][] = xmlsitemap_settings_node_uw_project
features[views_view][] = manage_projects
features[views_view][] = uw_project_audience_block
features[views_view][] = uw_project_by_audience_page
features[views_view][] = uw_project_by_topic_page
features[views_view][] = uw_project_content_block
features[views_view][] = uw_project_graduate_block
features[views_view][] = uw_project_instructors_block
features[views_view][] = uw_project_it_support_block
features[views_view][] = uw_project_page
features[views_view][] = uw_project_seeking_support_block
features[views_view][] = uw_project_topics_block
features[views_view][] = uw_project_undergraduate_block
stylesheets[all][] = css/uw_ct_project.css
This diff is collapsed.
<?php
/**
* @file
* Code for the Project feature.
*/
include_once 'uw_ct_project.features.inc';
/**
* Implements hook_block_info().
*/
function uw_ct_project_block_info() {
$blocks['project_by_status'] = array(
'info' => t('Projects by status'),
'cache' => DRUPAL_CACHE_PER_PAGE,
);
$blocks['project_by_topic'] = array(
'info' => t('Most common topics'),
'cache' => DRUPAL_CACHE_PER_PAGE,
);
return $blocks;
}
/**
* Implements hook_block_view().
*/
function uw_ct_project_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'project_by_status':
$html = '<div class="item-list">';
$html .= uw_ct_project_by_status();
$html .= '</div>';
if (uw_ct_project_by_status()) {
$block['subject'] = t('Projects by status');
$block['content'] = $html;
}
break;
case 'project_by_topic':
$html2 = '<div class="item-list">';
$html2 .= uw_ct_project_by_topic();
$html2 .= '</div>';
if (uw_ct_project_by_topic()) {
$block['subject'] = t('Most common topics');
$block['content'] = $html2;
}
break;
}
return $block;
}
function uw_ct_project_by_status() {
$project_status = uw_ct_project_get_project_status();
if ($project_status) {
$html = '<ul>';
foreach($project_status as $id => $item) {
if ($item['name'] == 'Current projects') {
$item_link = l($item['name'], 'projects/all_current_projects');
}
if ($item['name'] == 'Other initiatives') {
$item_link = l($item['name'], 'projects/all_other_initiatives');
}
if ($item['name'] == 'Proposed projects') {
$item_link = l($item['name'], 'projects/all_proposed_projects');
}
if ($item['name'] == 'Completed projects') {
$item_link = l($item['name'], 'projects/all_completed_projects');
}
$html .= '<li>';
$html .= $item_link;
$html .= ' (' . $item['count'] . ')';
$html .= '</li>';
}
$html .= '</ul>';
return $html;
}
}
function uw_ct_project_by_topic() {
$project_topic = uw_ct_project_get_project_topic();
if ($project_topic) {
$html = '<ul>';
foreach($project_topic as $id => $item) {
$html .= '<li>';
$html .= l($item['name'], 'projects/topic/'. $item['tid']);
$html .= ' (' . $item['count'] . ')';
$html .= '</li>';
}
$html .= '</ul>';
$html .= '<div class="view-all-topics">';
$html .= l('view all topics', 'projects/projects-by-topic/');
$html .= '</div>';
return $html;
}
}
function uw_ct_project_get_project_status() {
$query = "SELECT count(taxonomy_term_data.name) AS count, taxonomy_term_data.name AS name
FROM
{taxonomy_index} taxonomy_index
LEFT JOIN
{taxonomy_term_data} taxonomy_term_data ON
taxonomy_index.tid = taxonomy_term_data.tid
LEFT JOIN
{taxonomy_vocabulary} taxonomy_vocabulary ON
taxonomy_term_data.vid = taxonomy_vocabulary.vid
WHERE
machine_name = 'project_status'
GROUP BY
taxonomy_term_data.name
ORDER BY
taxonomy_vocabulary.weight ASC";
$result = db_query($query);
$return = false;
foreach ($result as $id => $record) {
$return[$id]['name'] = $record->name;
$return[$id]['count'] = $record->count;
}
return $return;
}
function uw_ct_project_get_project_topic() {
$query = "SELECT count, name, tid
FROM ( SELECT COUNT( taxonomy_term_data.name ) AS count, taxonomy_term_data.name AS name, taxonomy_term_data.tid AS tid
FROM
{taxonomy_index} taxonomy_index
LEFT JOIN
{taxonomy_term_data} taxonomy_term_data ON
taxonomy_index.tid = taxonomy_term_data.tid
LEFT JOIN
{taxonomy_vocabulary} taxonomy_vocabulary ON
taxonomy_term_data.vid = taxonomy_vocabulary.vid
WHERE
machine_name = 'project_topic'
GROUP BY
taxonomy_term_data.name
ORDER BY
count DESC , taxonomy_term_data.name
LIMIT 10 ) topten
ORDER BY name";
$result = db_query($query);
$return = false;
foreach ($result as $id => $record) {
$return[$id]['name'] = $record->name;
$return[$id]['count'] = $record->count;
$return[$id]['tid'] = $record->tid;
}
return $return;
}
/**
* Implements hook_page_build().
*
* Add the breadcrumbs for the views
*/
/*
function uw_ct_project_page_build() {
$path = current_path();
$path = explode("/", $path);
switch ($path[0]) {
case 'projects':
if (isset($path[1]) && ($path[1] == 'all_current_projects' || $path[1] == 'all_other_initiatives' || $path[1] == 'all_proposed_projects' || $path[1] == 'all_completed_projects' || $path[1] == 'projects-by-topic')) {
$breadcrumb = drupal_get_breadcrumb();
$breadcrumb[1] = l('Projects', 'projects');
drupal_set_breadcrumb($breadcrumb);
}
break;
}
}*/
\ No newline at end of file
<?php
/**
* @file
* uw_ct_project.strongarm.inc
*/
/**
* Implements hook_strongarm().
*/
function uw_ct_project_strongarm() {
$export = array();
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'additional_settings__active_tab_uw_project';
$strongarm->value = 'edit-menu';
$export['additional_settings__active_tab_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'enable_revisions_page_uw_project';
$strongarm->value = 1;
$export['enable_revisions_page_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'field_bundle_settings_node__uw_project';
$strongarm->value = array(
'view_modes' => array(
'teaser' => array(
'custom_settings' => TRUE,
),
'entity_teaser' => array(
'custom_settings' => TRUE,
),
'full' => array(
'custom_settings' => FALSE,
),
'rss' => array(
'custom_settings' => FALSE,
),
'search_index' => array(
'custom_settings' => FALSE,
),
'search_result' => array(
'custom_settings' => FALSE,
),
'token' => array(
'custom_settings' => FALSE,
),
),
'extra_fields' => array(
'form' => array(
'title' => array(
'weight' => '0',
),
'path' => array(
'weight' => '10',
),
'redirect' => array(
'weight' => '8',
),
'xmlsitemap' => array(
'weight' => '6',
),
),
'display' => array(),
),
);
$export['field_bundle_settings_node__uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'mb_content_cancel_uw_project';
$strongarm->value = '0';
$export['mb_content_cancel_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'mb_content_sac_uw_project';
$strongarm->value = '0';
$export['mb_content_sac_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'mb_content_tabcn_uw_project';
$strongarm->value = 0;
$export['mb_content_tabcn_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'menu_options_uw_project';
$strongarm->value = array();
$export['menu_options_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'menu_parent_uw_project';
$strongarm->value = 'main-menu:0';
$export['menu_parent_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'node_options_uw_project';
$strongarm->value = array(
0 => 'moderation',
1 => 'revision',
);
$export['node_options_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'node_preview_uw_project';
$strongarm->value = '1';
$export['node_preview_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'node_submitted_uw_project';
$strongarm->value = 0;
$export['node_submitted_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'pathauto_node_uw_project_pattern';
$strongarm->value = 'projects/[node:title]';
$export['pathauto_node_uw_project_pattern'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'pathauto_taxonomy_term_pattern';
$strongarm->value = '[term:vocabulary]/[term:name]';
$export['pathauto_taxonomy_term_pattern'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'pathauto_taxonomy_term_project_audience_pattern';
$strongarm->value = '';
$export['pathauto_taxonomy_term_project_audience_pattern'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'pathauto_taxonomy_term_project_status_pattern';
$strongarm->value = '';
$export['pathauto_taxonomy_term_project_status_pattern'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'pathauto_taxonomy_term_project_topic_pattern';
$strongarm->value = '';
$export['pathauto_taxonomy_term_project_topic_pattern'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'pathauto_taxonomy_term_uwaterloo_audience_pattern';
$strongarm->value = '';
$export['pathauto_taxonomy_term_uwaterloo_audience_pattern'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'save_continue_project';
$strongarm->value = 'Save and add fields';
$export['save_continue_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'schemaorg_type_uw_project';
$strongarm->value = '';
$export['schemaorg_type_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'show_diff_inline_uw_project';
$strongarm->value = 0;
$export['show_diff_inline_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'show_preview_changes_uw_project';
$strongarm->value = 1;
$export['show_preview_changes_uw_project'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'xmlsitemap_settings_node_uw_project';
$strongarm->value = array(
'status' => '1',
'priority' => '0.5',
);
$export['xmlsitemap_settings_node_uw_project'] = $strongarm;
return $export;
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment