/** * Show the list of contact fields in edit contact page * * @global array $company_fields List of contact fields * @param <type> $contact_id * * @since 0.1 */ function _rolo_show_edit_contact_form($contact_id) { global $contact_fields; $rolo_tab_index = 1000; $contact = get_post_meta($contact_id, 'rolo_contact'); $contact = $contact[0]; ?> <form action="" method="post" class="uniForm inlineLabels" id="contact-edit"> <div id="errorMsg"> <h3><?php _e('Campos obrigatórios não estão preenchidos.', 'rolopress'); ?> </h3> </div> <div id="addContact"> <div id="frameContainer"> <?php // Get one of the nine frames possible $pframe = get_post_meta($contact_id, 'rolo_contact_framename', true); $importance = $pframe[strlen($pframe) - 1]; $i = $pframe[strlen($pframe) - 2]; $previous = get_previous($i); $next = get_next($i); $previous_imp = get_previous($importance); $next_imp = get_next($importance); if (!empty($_GET['imp']) && $_GET['imp'] > 0 && $_GET['imp'] < 4) { $importance = $_GET['imp']; switch ($importance) { case 1: $next_imp = 2; $previous_imp = 3; break; case 3: $next_imp = 1; $previous_imp = 2; break; default: $next_imp = $importance + 1; $previous_imp = $importance - 1; break; } } if (!empty($_GET['pframe']) && $_GET['pframe'] > 0 && $_GET['pframe'] < 4) { $previous = get_previous($_GET['pframe']); $next = get_next($_GET['pframe']); $pframe = 'frame' . $_GET['pframe'] . $importance; } $frame_number = $pframe; global $_wp_additional_image_sizes; $w = $_wp_additional_image_sizes[$frame_number]['width']; $h = $_wp_additional_image_sizes[$frame_number]['height']; $current_pframe = $pframe[strlen($pframe) - 2]; ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script> <div id="contact"> <div class="photo" id="<?php echo $frame_number; ?> "> <a href="<?php echo $link; ?> "> <span class="droparea spot <?php echo $frame_number; ?> " data-width="<?php echo $w; ?> " data-height="<?php echo $h; ?> " data-type="jpg" data-crop="true" style="width: <?php echo $w; ?> px; height: <?php echo $h; ?> px"></span> <span class="<?php echo $frame_number; ?> " style="z-index: -100;"> <?php echo get_the_post_thumbnail($contact_id, $frame_number); // AQUI É ONDE É POSTA A FOTO ?> </span> </a> <img src="<?php echo get_bloginfo('template_url') . '/library/images/frames/' . $frame_number . '.png'; ?> " alt=""> <div class="title"> <?php the_title(); ?> </div> </div> <span class="info">Use as setas para escolher a moldura.</span><br/> <a id="change_frame_left" href="?id=<?php echo $contact_id; ?> &pframe=<?php echo $previous; ?> "> <img src="<?php echo get_bloginfo('stylesheet_directory'); ?> /img/esquerda.png"> </a> <a id="change_frame_right" href="?id=<?php echo $contact_id; ?> &pframe=<?php echo $next; ?> "> <img src="<?php echo get_bloginfo('stylesheet_directory'); ?> /img/direita.png"> </a> <br/> <span class="info">O quão importante é para si este contacto?</span><br/> <?php if ($importance != 1) { ?> <a id="change_frame_left" href="?id=<?php echo $contact_id; ?> &pframe=<?php echo $current_pframe; ?> &imp=<?php echo $previous_imp; ?> "> <img src="<?php echo get_bloginfo('stylesheet_directory'); ?> /img/minus.png"> </a> <?php } ?> <?php if ($importance != 3) { ?> <a id="change_frame_right" href="?id=<?php echo $contact_id; ?> &pframe=<?php echo $current_pframe; ?> &imp=<?php echo $next_imp; ?> "> <img src="<?php echo get_bloginfo('stylesheet_directory'); ?> /img/plus_s.png"> </a> <?php } ?> </div> <!-- close div contact --> <script src="http://simplephone.me/wp-content/themes/rolopress-core/library/js/droparea.js" type="text/javascript"></script> <script> jQuery('.droparea').droparea({ 'post' : 'http://simplephone.me/wp-content/themes/rolopress-core/library/includes/upload.php', 'init' : function(r){ //console.log('my init',r); }, 'start' : function(r){ //console.log('my start',r); }, 'error' : function(r){ //console.log('my error',r); }, 'complete' : function(r){ console.log('my complete',r); jQuery("#filename").attr("value", r.filename_original); } }); </script> </div> <!-- end frameContainer --> <div id="fieldContainer"> <fieldset class="inlineLabels"> <?php foreach ($contact_fields as $contact_field) { if (function_exists($contact_field['setup_function'])) { call_user_func_array($contact_field['setup_function'], array($contact_field['name'], &$rolo_tab_index, $contact_id)); } else { $name = 'rolo_contact_' . $contact_field['name']; $current_value = $contact[$name]; $class = $contact_field['class']; $mandatory_class = ''; if ($contact_field['mandatory'] == true) { $mandatory_class = ' mandatory'; } ?> <div class="ctrlHolder <?php echo $contact_field['class']; echo $mandatory_class; ?> "> <li><label for="<?php echo $name; ?> "> <?php if ($contact_field['mandatory'] == true) { echo '<em>*</em>'; } echo $contact_field['title']; ?> </label></li> <?php if (isset($contact_field['prefix']) == true) { echo '<span class="prefix '; echo $contact_field['name']; echo '">'; echo $contact_field['prefix']; echo '</span>'; $class = $contact_field['class'] . " " . "input-prefix"; } ?> <li> <input type="text" name="<?php echo $name; ?> " value="<?php echo $current_value; ?> " size="55" tabindex="<?php echo $rolo_tab_index; ?> " class="textInput <?php echo $class; ?> " /></li> </div> <?php $rolo_tab_index++; } } ?> </fieldset> </div> <div class="buttonHolder"> <input type="hidden" name="contact_id" value="<?php echo $contact_id; ?> " /> <input type="hidden" id="framename" name="framename" value="<?php echo $frame_number; ?> " /> <input type="hidden" id="filename" name="filename" value="" /> <input type="hidden" name="rp_edit_contact" value="edit_contact" /> <button type="submit" name="submit" id="edit_contact" class="submitButton" tabindex="<?php echo $rolo_tab_index++; ?> " ><?php _e('Editar Contacto', 'rolopress'); ?> </button> </div> </form> <?php }
</h1> </header> <div class="border-t border-b blog-nav u-textCenter u-cf"> <?php $month = ''; $year = ''; $today = date('d M'); // try to get the date from the url if (isset($_GET['month']) && isset($_GET['year'])) { $current = array("month" => $_GET['month'], "year" => $_GET['year']); } else { $current = array("month" => date('m'), "year" => date('Y')); } $next = get_next($current); $previous = get_previous($current); // example: returns '14' from 2014 $custom_prev_year = substr($previous['year'], -2); $custom_current_year = substr($current['year'], -2); $custom_next_year = substr($next['year'], -2); ?> <div class="blog-nav__link"> <span class="btn btn-skin u-inlineBlock u-valign-middle"> <a href="<?php echo get_permalink(22); ?> ?month=<?php echo $previous['month']; ?> &year=<?php echo $previous['year'];