function cvtx_antrag_kuerzel($post, $strip_nl = true) { if ($post->post_type == 'cvtx_aeantrag') { $antrag = get_post(get_post_meta($post->ID, 'cvtx_aeantrag_antrag', true)); echo cvtx_get_latex(cvtx_get_short($antrag), $strip_nl); } }
/** * themed output of all aenderungsantraege to given post or post_id * * @param post_id Do you want a specific posts aenderungsantraege? * */ function cvtx_spd_aenderungsantraege_action($post_id = false) { if (!isset($post_id) || !$post_id) { global $post; } else { $post = get_post($post_id); } // specify wp_query for all aenderungsantraege to given ID $loop = new WP_Query(array('post_type' => 'cvtx_aeantrag', 'meta_key' => 'cvtx_sort', 'orderby' => 'meta_value', 'order' => 'ASC', 'nopaging' => true, 'meta_query' => array(array('key' => 'cvtx_aeantrag_antrag', 'value' => $post->ID, 'compare' => '=')))); if ($loop->have_posts()) { ?> <div id="ae_antraege" class="entry-content"> <h3><?php _e('Amendments', 'cvtx'); if (isset($_GET['ae_antraege']) && $_GET['ae_antraege'] == 1) { _e(' to ', 'cvtx') . cvtx_get_short($post); } ?> </h3> <table cellpadding="3" cellspacing="0" valign="top" class="ae_antraege_table"> <tr> <th><strong><?php _e('Page', 'cvtx'); ?> </strong></th> <th><strong><?php _e('Line', 'cvtx'); ?> </strong></th> <th><strong><?php _e('Author(s)', 'cvtx'); ?> </strong></th> <th><strong><?php _e('Text', 'cvtx'); ?> </strong></th> <th><strong><?php _e('Explanation', 'cvtx'); ?> </strong></th> <th><strong><?php _e('Version AK', 'cvtx'); ?> </strong></th> </tr> <?php while ($loop->have_posts()) { $loop->the_post(); ?> <tr <?php if (cvtx_map_procedure(get_post_meta($post->ID, 'cvtx_aeantrag_verfahren', true)) === 'd') { echo 'class="withdrawn"'; } ?> > <td class="seite"><strong><?php echo get_post_meta($post->ID, 'cvtx_aeantrag_seite', true); ?> </strong></td> <td class="zeile"><strong><?php echo get_post_meta($post->ID, 'cvtx_aeantrag_zeile', true); ?> </strong></td> <td class="steller"><?php echo get_post_meta($post->ID, 'cvtx_aeantrag_steller_short', true); ?> </td> <td class="text"><?php the_content(); ?> </td> <td class="grund"><?php echo get_post_meta($post->ID, 'cvtx_aeantrag_grund', true); ?> </td> <td class="verfahren"><span class="flag <?php echo cvtx_map_procedure(get_post_meta($post->ID, 'cvtx_aeantrag_verfahren', true)); ?> "></span><span class="procedure"><span class="arrow"></span><?php echo get_post_meta($post->ID, $post->post_type . '_ak_recommendation', true) . ' ' . short_konsens(get_post_meta($post->ID, $post->post_type . '_ak_konsens', true)); $version_ak = get_post_meta($post->ID, $post->post_type . '_version_ak', true); if (is_plugin_active('html-purified/html-purified.php')) { global $cvtx_purifier, $cvtx_purifier_config; $version_ak = $cvtx_purifier->purify($version_ak, $cvtx_purifier_config); } $version_ak = trim($version_ak); if ($version_ak) { echo '<p/>' . $version_ak; } ?> </span></td> </tr> <?php } ?> </table> </div> <?php } wp_reset_postdata(); }
</tr> </thead> <tbody> <?php while ($loop->have_posts()) { $loop->the_post(); ?> <?php $event_id = get_post_meta($post->post_type == 'cvtx_aeantrag' ? get_post_meta($post->ID, 'cvtx_aeantrag_antrag', true) : $post->ID, ($post->post_type == 'cvtx_aeantrag' ? 'cvtx_antrag' : $post->post_type) . '_event', true); ?> <tr> <td><a href="<?php echo get_permalink($post->ID); ?> "><?php print cvtx_get_short($post); ?> </a></td> <td><?php print get_post_meta($post->ID, $post->post_type . '_poll', true); ?> </td> <td><?php print get_post_meta($post->ID, 'cvtx_antrag_steller', true); ?> </td> <td><?php $reps = wp_get_post_terms($post->ID, 'cvtx_tax_assign_to'); if (!empty($reps)) { $recipients = ''; for ($i = 0; $i < count($reps); $i++) {
/** * themed output for add_aenderungsantraege */ function cvtx_add_aeantrag_action($args = array('post_id' => false, 'show_recaptcha' => true)) { if (!isset($args['post_id']) || !$args['post_id']) { global $post; } else { $post = get_post($post_id); } if (is_object($post) && $post->post_type == 'cvtx_antrag') { echo '<div id="add_aeantrag" class="entry-content">'; printf(__('<h3>Create amendment to %s</h3>', 'cvtx'), cvtx_get_short($post)); cvtx_submit_aeantrag($post->ID, isset($args) && is_array($args) && isset($args['show_recaptcha']) ? $args['show_recaptcha'] : true); echo '</div>'; } }
function cvtx_antrag_predefined_event() { $options = get_option('cvtx_options'); global $wpdb; $ids = $wpdb->get_col("\n SELECT DISTINCT p.ID\n FROM {$wpdb->posts} p\n INNER JOIN {$wpdb->postmeta} cvtxsort\n ON cvtxsort.post_id = p.ID\n AND cvtxsort.meta_key = 'cvtx_sort'\n WHERE p.post_type = 'cvtx_event'\n ORDER BY cvtxsort.meta_value DESC\n "); $values = array(); foreach ($ids as $id) { $post = get_post($id); $values[] = array("id" => $post->ID, "title" => cvtx_get_short($post)); } ?> <select name="cvtx_options[cvtx_antrag_predefined_event]" id="cvtx_antrag_predefined_event"> <option value=""><?php _e('Nicht festlegen', 'cvtx'); ?> </option> <?php $current_v = isset($options['cvtx_antrag_predefined_event']) ? $options['cvtx_antrag_predefined_event'] : ''; foreach ($values as $label => $value) { printf('<option value="%s"%s>%s</option>', $value["id"], $value["id"] == $current_v ? ' selected="selected"' : '', $value["title"]); } ?> </select> <span class="description">(Die hier voreingestellte Veranstaltung wird überall im Admin-Bereich ausgewählt und Beiträge danach gefiltert.)</span> <?php }
/** * replaces filter "the title" in order to generate custom titles for post-types "top", "antrag" and "aeantrag" */ function cvtx_the_title($before = '', $after = '') { global $cvtx_types, $cvtx_mime_types; if (is_numeric($after)) { $post = get_post($after); } if (isset($post)) { $title = !empty($post->post_title) ? $post->post_title : __('(no title)', 'cvtx'); // add short name as prefix if ($short = cvtx_get_short($post)) { // Antrag or application if ($post->post_type == 'cvtx_antrag') { $title = $short . ' ' . $title; } else { if ($post->post_type == 'cvtx_application') { $name = trim(get_post_meta($post->ID, 'cvtx_application_prename', true) . ' ' . get_post_meta($post->ID, 'cvtx_application_surname', true)); $title = $short . ' ' . (!empty($name) ? $name : $title); } else { if ($post->post_type == 'cvtx_aeantrag') { $title = $short; } else { if ($post->post_type == 'cvtx_event') { $title = $short; } else { if ($post->post_type == 'cvtx_top' && get_post_meta($post->ID, 'cvtx_top_appendix', true) != 'on') { $title = sprintf(__('agenda_point_prefix_format', 'cvtx'), get_post_meta($post->ID, 'cvtx_top_ord', true)) . ' ' . $title; } } } } } } else { if ($post->post_type == 'attachment' && ($parent = get_post($post->post_parent))) { if (in_array($parent->post_type, array_keys($cvtx_types))) { $title = ''; // post type switch ($parent->post_type) { case 'cvtx_reader': $title .= __('Reader', 'cvtx'); break; case 'cvtx_antrag': $title .= __('Resolution', 'cvtx'); break; case 'cvtx_aeantrag': $title .= __('Amendment', 'cvtx'); break; case 'cvtx_application': $title .= __('Application', 'cvtx'); break; } $title .= ' '; // short name, post title or no title if ($short = cvtx_get_short($parent)) { $title .= $short; } else { if (!empty($parent->post_title)) { $title .= $parent->post_title; } else { $title .= __('(no title)', 'cvtx'); } } // add mime type $mimes = array_flip($cvtx_mime_types); $title .= ' (' . $mimes[$post->post_mime_type] . ')'; return $title; } } else { return !empty($before) ? $before : __('(no title)', 'cvtx'); } } return $title; } else { return $before; } }
<p class="postmetadata alt"> <small><?php printf(__('This %1$s was published on %2$s at %3$s.'), get_post_type_object(get_post_type())->labels->singular_name, get_the_time(__('j. F Y')), get_the_time()); ?> </small> </p> <?php global $post; // specify wp_query for all aenderungsantraege to given ID $loop = new WP_Query(array('post_type' => 'cvtx_aeantrag', 'meta_key' => 'cvtx_sort', 'orderby' => 'meta_value', 'order' => 'ASC', 'nopaging' => true, 'meta_query' => array(array('key' => 'cvtx_aeantrag_antrag', 'value' => $post->ID, 'compare' => '=')))); if ($loop->have_posts()) { ?> <div id="ae_antraege" class="noellipsis"> <h3><?php print __('Amendments', 'cvtx'); print isset($_GET['ae_antraege']) && $_GET['ae_antraege'] == 1 ? __(' to ', 'cvtx') . cvtx_get_short($post) : ''; ?> </h3> <ul data-role="listview" data-inset="true"> <?php while ($loop->have_posts()) { $loop->the_post(); ?> <li><span class="ui-li-aside"><?php _e('Line', 'cvtx'); ?> : <strong><?php print get_post_meta($post->ID, 'cvtx_aeantrag_zeile', true); ?> </strong></span> <h3><?php