function connectionsShowRolesPage() { /* * Check whether user can edit roles */ if (!current_user_can('connections_change_roles')) { wp_die('<p id="error-page" style="-moz-background-clip:border; -moz-border-radius:11px; background:#FFFFFF none repeat scroll 0 0; border:1px solid #DFDFDF; color:#333333; display:block; font-size:12px; line-height:18px; margin:25px auto 20px; padding:1em 2em; text-align:center; width:700px">' . __('You do not have sufficient permissions to access this page.', 'connections') . '</p>'); } else { global $connections, $wp_roles; $form = new cnFormObjects(); ?> <div class="wrap cn-roles"> <?php echo get_screen_icon('connections'); ?> <h2>Connections : <?php _e('Roles & Capabilities', 'connections'); ?> </h2> <?php $attr = array('action' => '', 'method' => 'post'); $form->open($attr); $form->tokenField('update_role_settings'); ?> <div id="poststuff" class="metabox-holder has-right-sidebar"> <div class="inner-sidebar" id="side-info-column"> <div id="submitdiv" class="postbox"> <h3 class="hndle" style="cursor: auto;"> <span><?php _e('Save Changes or Reset', 'connections'); ?> </span> </h3> <div class="inside"> <div id="minor-publishing"> <label for="reset_all_roles"> <input type="checkbox" id="reset_all_roles" name="reset_all" value="true"> <?php _e('Reset All Role Capabilities', 'connections'); ?> </label> </div> <div id="major-publishing-actions"> <div id="publishing-action"> <input type="hidden" name="cn-action" value="update_role_capabilities"/> <input class="button-primary" type="submit" value="<?php _e('Update', 'connections'); ?> " name="save" /> </div> <div class="clear"></div> </div> </div> </div> </div> <div class="has-sidebar" id="post-body"> <div class="has-sidebar-content" id="post-body-content"> <?php $editable_roles = get_editable_roles(); foreach ($editable_roles as $role => $details) { $name = translate_user_role($details['name']); // the admininistrator should always have all capabilities if ($role == 'administrator') { continue; } $capabilies = cnRole::capabilities(); echo '<div class="postbox">'; echo '<h3 class="hndle" style="cursor: auto;"><span>', $name, '</span></h3>'; echo '<div class="inside">'; foreach ($capabilies as $capability => $capabilityName) { // if unregistered users are permitted to view the entry list there is no need for setting this capability if ($capability == 'connections_view_public' && $connections->options->getAllowPublic() == true) { continue; } echo '<span style="display: block;"><label for="' . $role . '_' . $capability . '">'; echo '<input type="hidden" name="roles[' . $role . '][capabilities][' . $capability . ']" value="false" />'; echo '<input type="checkbox" id="' . $role . '_' . $capability . '" name="roles[' . $role . '][capabilities][' . $capability . ']" value="true" '; if (cnRole::hasCapability($role, $capability)) { echo 'CHECKED '; } // the admininistrator should always have all capabilities if ($role == 'administrator') { echo 'DISABLED '; } echo '/> ' . $capabilityName . '</label></span>' . "\n"; } echo '<span style="display: block;"><label for="' . $role . '_reset_capabilities">'; echo '<input type="checkbox" id="' . $role . '_reset_capabilities" name="reset[' . $role . ']" value="' . $name . '" /> '; echo sprintf(__('Reset %s Capabilities', 'connections'), $name) . '</label></span>' . "\n"; echo '</div>'; echo '</div>'; } ?> </div> </div> </div> <?php $form->close(); ?> </div> <div class="clear"></div> <?php } }
function connectionsShowRolesPage() { /* * Check whether user can edit roles */ if (!current_user_can('connections_change_roles')) { wp_die('<p id="error-page" style="-moz-background-clip:border; -moz-border-radius:11px; background:#FFFFFF none repeat scroll 0 0; border:1px solid #DFDFDF; color:#333333; display:block; font-size:12px; line-height:18px; margin:25px auto 20px; padding:1em 2em; text-align:center; width:700px">You do not have sufficient permissions to access this page.</p>'); } else { global $connections, $wp_roles; $form = new cnFormObjects(); $connections->displayMessages(); /*if (isset($_POST['submit'])) { if (isset($_POST['roles'])) { // Cycle thru each role available because checkboxes do not report a value when not checked. foreach ($wp_roles->get_names() as $role => $name) { if (!isset($_POST['roles'][$role])) continue; foreach ($_POST['roles'][$role]['capabilities'] as $capability => $grant) { // the admininistrator should always have all capabilities if ($role == 'administrator') continue; if ($grant == 'true') { $connections->options->addCapability($role, $capability); } else { $connections->options->removeCapability($role, $capability); } } } } if (isset($_POST['reset'])) $connections->options->setDefaultCapabilities($_POST['reset']); if (isset($_POST['reset_all'])) $connections->options->setDefaultCapabilities(); echo "<div id='message' class='updated fade'>"; echo "<p><strong>Role capabilities have been updated.</strong></p>"; echo "</div>"; }*/ ?> <div class="wrap"> <div id="icon-connections" class="icon32"> <br> </div> <h2>Connections : Roles & Capabilities</h2> <?php $attr = array( 'action' => 'admin.php?page=connections_roles&action=update_role_settings', 'method' => 'post', ); $form->open($attr); $form->tokenField('update_role_settings'); ?> <div class="form-wrap"> <?php $editable_roles = get_editable_roles(); foreach( $editable_roles as $role => $details ) { $name = translate_user_role($details['name'] ); // the admininistrator should always have all capabilities if ($role == 'administrator') continue; echo '<div class="form-field connectionsform">'; echo '<table class="form-table">'; echo '<tbody>'; echo '<tr valign="top">'; echo '<th scope="row">'; echo $name; echo '</th>'; echo '<td>'; $capabilies = $connections->options->getDefaultCapabilities(); foreach ($capabilies as $capability => $capabilityName) { // if unregistered users are permitted to view the entry list there is no need for setting this capability if ($capability == 'connections_view_public' && $connections->options->getAllowPublic() == true) continue; echo '<label for="' . $role . '_' . $capability . '">'; echo '<input type="hidden" name="roles[' . $role . '][capabilities][' . $capability . ']" value="false" />'; echo '<input type="checkbox" id="' . $role . '_' . $capability . '" name="roles[' . $role . '][capabilities][' . $capability . ']" value="true" '; if ($connections->options->hasCapability($role, $capability)) echo 'CHECKED '; // the admininistrator should always have all capabilities if ($role == 'administrator') echo 'DISABLED '; echo '/> ' . $capabilityName . '</label>' . "\n"; } echo '<label for="' . $role . '_reset_capabilities">'; echo '<input type="checkbox" id="' . $role . '_reset_capabilities" name="reset[' . $role . ']" value="' . $name . '" '; echo '/> Reset ' . $name . ' Capabilities</label>' . "\n"; echo '</td>'; echo '</tr>'; echo '</tbody>'; echo '</table>'; echo '</div>'; } ?> <div class="form-field" style="background-color:#FFFBCC; border: 1px solid #E6DB55; -moz-border-radius:3px; border-style:solid; border-width:1px;"> <table class="form-table"> <tbody> <tr valign="top"> <th scope="row"> Reset </th> <td> <label for="reset_all_roles"> <input type="checkbox" id="reset_all_roles" name="reset_all" value="true"> Reset All Role Capabilities </label> </td> </tr> </tbody> </table> </div> </div> <p class="submit"><input class="button-primary" type="submit" value="Save Changes" name="save" /></p> <?php $form->close(); ?> </div> <div class="clear"></div> <?php } }
function connectionsShowCategoriesPage() { /* * Check whether user can edit catgories. */ if (!current_user_can('connections_edit_categories')) { wp_die('<p id="error-page" style="-moz-background-clip:border; -moz-border-radius:11px; background:#FFFFFF none repeat scroll 0 0; border:1px solid #DFDFDF; color:#333333; display:block; font-size:12px; line-height:18px; margin:25px auto 20px; padding:1em 2em; text-align:center; width:700px">You do not have sufficient permissions to access this page.</p>'); } else { global $connections; $form = new cnFormObjects(); $categoryObjects = new cnCategoryObjects(); if (isset($_GET['action'])) { $action = $_GET['action']; } else { $action = NULL; } if ($action === 'edit') { $id = esc_attr($_GET['id']); check_admin_referer('category_edit_' . $id); ?> <div class="wrap"> <div class="form-wrap" style="width:600px; margin: 0 auto;"> <h2><a name="new"></a>Edit Category</h2> <?php $attr = array('action' => 'admin.php?page=connections_categories&action=update', 'method' => 'post', 'id' => 'addcat', 'name' => 'updatecategory'); $form->open($attr); $form->tokenField('update_category'); $categoryObjects->showForm($connections->retrieve->category($id)); ?> <p class="submit"><a class="button button-warning" href="admin.php?page=connections_categories">Cancel</a> <input class="button-primary" type="submit" value="Update Category" name="update" class="button"/></p> <?php $form->close(); ?> </div> </div> <?php } else { ?> <div class="wrap nosubsub"> <div class="icon32" id="icon-connections"><br/></div> <h2>Connections : Categories</h2> <?php echo $connections->displayMessages(); ?> <div id="col-container"> <div id="col-right"> <div class="col-wrap"> <?php $attr = array('action' => 'admin.php?page=connections_categories&action=bulk_delete', 'method' => 'post'); $form->open($attr); $form->tokenField('bulk_delete_category'); ?> <div class="tablenav"> <div class="alignleft actions"> <select name="action"> <option selected="selected" value="">Bulk Actions</option> <option value="delete">Delete</option> </select> <input type="submit" class="button-secondary action" id="doaction" name="doaction" value="Apply"/> </div> <br class="clear"/> </div> <div class="clear"/></div> <table cellspacing="0" class="widefat fixed"> <thead> <tr> <th class="manage-column column-cb check-column" id="cb" scope="col"><input type="checkbox"/></th> <th class="manage-column column-name" id="name" scope="col">Name</th> <th class="manage-column column-description" id="description" scope="col">Description</th> <th class="manage-column column-slug" id="slug" scope="col">Slug</th> <th class="manage-column column-posts" id="posts" scope="col">Info</th> </tr> </thead> <tfoot> <tr> <th class="manage-column column-cb check-column" scope="col"><input type="checkbox"/></th> <th class="manage-column column-name" scope="col">Name</th> <th class="manage-column column-description" scope="col">Description</th> <th class="manage-column column-slug" scope="col">Slug</th> <th class="manage-column column-posts" scope="col">Info</th> </tr> </tfoot> <tbody class="list:cat" id="the-list"> <?php echo $categoryObjects->buildCategoryRow('table', $connections->retrieve->categories()); ?> </tbody> </table> <?php $form->close(); ?> <script type="text/javascript"> /* <![CDATA[ */ (function($){ $(document).ready(function(){ $('#doaction, #doaction2').click(function(){ if ( $('select[name^="action"]').val() == 'delete' ) { var m = 'You are about to delete the selected category(ies).\n \'Cancel\' to stop, \'OK\' to delete.'; return showNotice.warn(m); } }); }); })(jQuery); /* ]]> */ </script> <div class="form-wrap"> <p><strong>Note:</strong><br/>Deleting a category which has been assigned to an entry will reassign that entry as <strong>Uncategorized</strong>.</p> </div> </div> </div><!-- right column --> <div id="col-left"> <div class="col-wrap"> <div class="form-wrap"> <h3>Add Category</h3> <?php $attr = array('action' => 'admin.php?page=connections_categories&action=add', 'method' => 'post', 'id' => 'addcat', 'name' => 'addcat'); $form->open($attr); $form->tokenField('add_category'); $categoryObjects->showForm(); ?> <p class="submit"><input type="submit" value="Save Category" name="add" class="button"/></p> <?php $form->close(); ?> </div> </div> </div><!-- left column --> </div><!-- Column container --> </div> <?php } } }
function connectionsShowTemplatesPage() { /* * Check whether user can edit Settings */ if (!current_user_can('connections_manage_template')) { wp_die('<p id="error-page" style="-moz-background-clip:border; -moz-border-radius:11px; background:#FFFFFF none repeat scroll 0 0; border:1px solid #DFDFDF; color:#333333; display:block; font-size:12px; line-height:18px; margin:25px auto 20px; padding:1em 2em; text-align:center; width:700px">You do not have sufficient permissions to access this page.</p>'); } else { global $connections; $form = new cnFormObjects(); $tmplt = new cnTemplate(); $tmplt->buildCatalog(); !isset($_GET['type']) ? $type = 'all' : ($type = esc_attr($_GET['type'])); $templates = $tmplt->getCatalog($type); $connections->displayMessages(); ?> <div class="wrap"> <div id="icon-connections" class="icon32"> <br> </div> <h2>Connections : Templates</h2> <ul class="subsubsub"> <li><a <?php if ($type === 'all') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=all">All</a> | </li> <li><a <?php if ($type === 'individual') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=individual">Individual</a> | </li> <li><a <?php if ($type === 'organization') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=organization">Organization</a> | </li> <li><a <?php if ($type === 'family') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=family">Family</a> | </li> <li><a <?php if ($type === 'anniversary') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=anniversary">Anniversary</a> | </li> <li><a <?php if ($type === 'birthday') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=birthday">Birthday</a></li> </ul> <table cellspacing="0" cellpadding="0" id="availablethemes"> <tbody> <tr> <td class="current_template"> <h2>Current Template</h2> <div id="current-theme"> <?php $currentTemplate = $connections->options->getActiveTemplate($type); if (!empty($currentTemplate)) { $author = ''; if (isset($currentTemplate->thumbnailPath)) { echo '<div class="current-template"><img class="template-thumbnail" src="' . $currentTemplate->thumbnailURL . '" /></div>'; } if (isset($currentTemplate->uri)) { $author = '<a title="Visit author\'s homepage." href="http://' . esc_attr($currentTemplate->uri) . '">' . esc_attr($currentTemplate->author) . '</a>'; } else { $author = esc_attr($currentTemplate->author); } echo '<h3>', esc_attr($currentTemplate->name), ' ', esc_attr($currentTemplate->version), ' by ', $author, '</h3>'; echo '<p class="theme-description">', esc_attr($currentTemplate->description), '</p>'; // Remove the current template so it does not show in the available templates. unset($templates->{$currentTemplate->slug}); } ?> </div> <div class="clear"></div> </td> <td class="template_instructions" colspan="2"> <p><strong>Instructions:</strong></p> <p> By default the <code>[connections_list]</code> shortcode will show all entries types. To change the template used when displaying all entry types, select the "All" tab and activate the template. When the <code>list_type</code> shortcode attribute is used to filter the entries based on the entry type, the template for that entry type will be used. To change the template used for specific entry type, select the appropriate tab and then activate the template. If multiple entry types are specified in the <code>list_type</code> shortcode attribute, the template for the entry type listed first will be used to display the entry list. </p> <p> The <code>[upcoming_list]</code> shortcode which displays the upcoming anniversaries and birthdays will be displayed with the template that is activated under their respective tabs. </p> <p> The current active template for each template type can be overridden by using the the <code>template</code> shortcode attribute. </p> </td> </tr> <tr> <td class="install_template" colspan="3"> <h2>Install Template</h2> <?php $formAttr = array('action' => 'admin.php?page=connections_templates&type=' . $type . '&action=install', 'method' => 'post', 'enctype' => 'multipart/form-data'); $form->open($formAttr); $form->tokenField('install_template'); ?> <p> <label for='template'>Select Template: <input type='file' value='' name='template' size='25' /> </label> <input type="submit" value="Install Now" class="button"> </p> <?php $form->close(); ?> </td> </tr> <tr> <td class="current_template" colspan="3"> <h2>Available Templates</h2> </td> </tr> <?php $templateNames = array_keys((array) $templates); natcasesort($templateNames); $table = array(); $rows = ceil(count((array) $templates) / 3); for ($row = 1; $row <= $rows; $row++) { for ($col = 1; $col <= 3; $col++) { $table[$row][$col] = array_shift($templateNames); } } foreach ($table as $row => $cols) { ?> <tr> <?php foreach ($cols as $col => $slug) { $activateTokenURL = NULL; $deleteTokenURL = NULL; $class = array('available-theme'); if ($row == 1) { $class[] = 'top'; } if ($row == $rows) { $class[] = 'bottom'; } if ($col == 1) { $class[] = 'left'; } if ($col == 3) { $class[] = 'right'; } ?> <td class="<?php echo join(' ', $class); ?> "> <?php if (!isset($templates->{$slug})) { continue; } $author = ''; if (isset($templates->{$slug}->thumbnailPath)) { echo '<div class="center-thumbnail"><img class="template-thumbnail" src="' . $templates->{$slug}->thumbnailURL . '" /></div>'; } if (isset($templates->{$slug}->uri)) { $author = '<a title="Visit author\'s homepage." href="' . esc_attr($templates->{$slug}->uri) . '">' . esc_attr($templates->{$slug}->author) . '</a>'; } else { $author = esc_attr($templates->{$slug}->author); } echo '<h3>', esc_attr($templates->{$slug}->name), ' ', esc_attr($templates->{$slug}->version), ' by ', $author, '</h3>'; echo '<p class="description">', esc_attr($templates->{$slug}->description), '</p>'; echo '<p>Shortcode Override: <code>template="' . $slug . '"</code></p>'; if ($templates->{$slug}->custom === FALSE) { echo '<p>This a supplied template and can not be deleted.</p>'; } ?> <span class="action-links"> <?php $activateTokenURL = $form->tokenURL('admin.php?page=connections_templates&action=activate&type=' . $type . '&template=' . esc_attr($templates->{$slug}->slug), 'activate_' . esc_attr($templates->{$slug}->slug)); if ($templates->{$slug}->custom === TRUE) { $deleteTokenURL = $form->tokenURL('admin.php?page=connections_templates&action=delete&type=' . $type . '&template=' . esc_attr($templates->{$slug}->slug), 'delete_' . esc_attr($templates->{$slug}->slug)); } ?> <a class="activatelink" href="<?php echo esc_attr($activateTokenURL); ?> " title="Activate '<?php echo esc_attr($templates->{$slug}->name); ?> '">Activate</a> <?php if (isset($deleteTokenURL)) { ?> | <a class="deletelink" href="<?php echo esc_attr($deleteTokenURL); ?> " title="Delete '<?php echo esc_attr($templates->{$slug}->name); ?> '" onclick="return confirm('You are about to delete this theme \'<?php echo esc_attr($templates->{$slug}->name); ?> \'\n \'Cancel\' to stop, \'OK\' to delete.');">Delete</a> <?php } ?> </span> </td> <?php } ?> </tr> <?php } ?> </tbody> </table> </div> <?php } }
function connectionsShowAddPage() { /* * Check whether user can add entries */ if (!current_user_can('connections_add_entry')) { wp_die('<p id="error-page" style="-moz-background-clip:border; -moz-border-radius:11px; background:#FFFFFF none repeat scroll 0 0; border:1px solid #DFDFDF; color:#333333; display:block; font-size:12px; line-height:18px; margin:25px auto 20px; padding:1em 2em; text-align:center; width:700px">You do not have sufficient permissions to access this page.</p>'); } else { global $connections; /* * If an entry is being copied, load it so it can be used in the form. */ if (isset($_GET['id'])) { $id = esc_attr($_GET['id']); $atts['id'] = $id; $entry = $connections->retrieve->entry($id); } else { $entry = NULL; } $entryForm = new cnEntryForm(); $form = new cnFormObjects(); $connections->displayMessages(); ?> <div class="wrap"> <div id="icon-connections" class="icon32"> <br> </div> <h2>Connections : Add Entry</h2> <div class="form-wrap" style="width:880px; margin: 0 auto;"> <div id="poststuff" class="metabox-holder has-right-sidebar"> <?php $attr = array('action' => 'admin.php?page=connections_add&action=add', 'method' => 'post', 'enctype' => 'multipart/form-data'); /* * If an entry is being copied add it to the query string. */ if (isset($id)) { $attr['action'] .= '&id=' . $id; } $form->open($attr); $form->tokenField('add_entry'); echo '<div id="side-info-column" class="inner-sidebar">'; do_meta_boxes('connections_add', 'side', ''); echo '</div>'; $entryForm->displayForm($entry); $form->close(); ?> </div> </div> </div> <?php } }
function connectionsShowSettingsPage() { /* * Check whether user can edit Settings */ if (!current_user_can('connections_change_settings')) { wp_die('<p id="error-page" style="-moz-background-clip:border; -moz-border-radius:11px; background:#FFFFFF none repeat scroll 0 0; border:1px solid #DFDFDF; color:#333333; display:block; font-size:12px; line-height:18px; margin:25px auto 20px; padding:1em 2em; text-align:center; width:700px">You do not have sufficient permissions to access this page.</p>'); } else { global $connections; $form = new cnFormObjects(); $connections->displayMessages(); ?> <div class="wrap"> <div id="icon-connections" class="icon32"> <br> </div> <h2>Connections : Settings</h2> <?php $attr = array( 'action' => 'admin.php?page=connections_settings&action=update_settings', 'method' => 'post', ); $form->open($attr); $form->tokenField('update_settings'); ?> <div class="form-wrap"> <div class="form-field connectionsform"> <table class="form-table"> <tbody> <tr valign="top"> <th scope="row"> Public Entries </th> <td> <label for="allow_public"> <input type="checkbox" value="true" name="settings[allow_public]" id="allow_public" <?php if ($connections->options->getAllowPublic()) echo 'CHECKED ' ?> /> Allow unregistered visitors and users not logged in to view entries<br /> <small>(When disabled, use roles to define which roles may view the public entries.)</small> </label> <label for="allow_public_override"> <input type="checkbox" value="true" name="settings[allow_public_override]" id="allow_public_override" <?php if ($connections->options->getAllowPublicOverride()) echo 'CHECKED ' ?> <?php if ($connections->options->getAllowPublic()) echo 'DISABLED ' ?> /> Allow shortcode attribute override </label> </td> </tr> </tbody> </table> </div> <div class="form-field connectionsform"> <table class="form-table"> <tbody> <tr valign="top"> <th scope="row"> Private Entries </th> <td> <label for="allow_private_override"> <input type="hidden" value="false" name="settings[allow_private_override]"/> <input type="checkbox" value="true" name="settings[allow_private_override]" id="allow_private_override" <?php if ($connections->options->getAllowPrivateOverride()) echo 'CHECKED ' ?> /> Allow shortcode attribute override </label> </td> </tr> </tbody> </table> </div> <div class="form-field connectionsform"> <h3>Thumbnail Image Settings</h3> <table class="form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="image_thumbnail_quality">JPEG Quality</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgThumbQuality() ?>" id="image_thumbnail_quality" name="settings[image][thumbnail][quality]"/>% </td> <td rowspan="4" width="50%"> <p>Changing the Quality setting will affect the image quality as well the file size. If you require smaller file sizes and can accept lower image quality, reduce the value.</p> <p>The values entered for the width and height will be the final size of the image. If the image is smaller, white space will be added to the image with the image centered. If the image is larger in either dimension it will be scaled down. The crop setting defines how the image will be scaled down.</p> <p>Crop will use the image's smaller dimension and scale it to fit and then crop the excess image from both sides or top and bottom equally of the larger dimension.</p> <p>Shrink will use the image's larger dimension and scale it to fit and then add white space equally to both sides or top and bottom equally to the smaller dimension.</p> <p>None will scale both image dimensions to fit the entered values un-proportionally.</p> <p><strong>NOTE: </strong>Although these options are available they are not recommended to be changed.</p> <p><strong>NOTE: </strong>Changes will only be applied to images uploaded after the change was saved. This will not affect images uploaded previously.</p> <p><strong>Default Values: </strong>Quality: 80%; Width: 80px; Height: 54px; Crop</p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="image_thumbnail_x">Width</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgThumbX() ?>" id="image_thumbnail_x" name="settings[image][thumbnail][x]"/>px </td> </tr> <tr valign="top"> <th scope="row"> <label for="image_thumbnail_y">Height</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgThumbY() ?>" id="image_thumbnail_y" name="settings[image][thumbnail][y]"/>px </td> </tr> <tr valign="top"> <th scope="row"> Crop </th> <td> <?php echo $form->buildRadio('settings[image][thumbnail][crop]', 'image_thumbnail_crop', array('Crop (maintain aspect ratio)' => 'crop', 'Shrink (maintain aspect ratio)' => 'fill', 'None' => 'none'), $connections->options->getImgThumbCrop()); ?> </td> </tr> </tbody> </table> </div> <div class="form-field connectionsform"> <h3>Entry Image Settings</h3> <table class="form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="image_entry_quality">JPEG Quality</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgEntryQuality() ?>" id="image_entry_quality" name="settings[image][entry][quality]"/>% </td> <td rowspan="4" width="50%"> <p>Changing the Quality setting will affect the image quality as well the file size. If you require smaller file sizes and can accept lower image quality, reduce the value.</p> <p>The values entered for the width and height will be the final size of the image. If the image is smaller, white space will be added to the image with the image centered. If the image is larger in either dimension it will be scaled down. The crop setting defines how the image will be scaled down.</p> <p>Crop will use the image's smaller dimension and scale it to fit and then crop the excess image from both sides or top and bottom equally of the larger dimension.</p> <p>Shrink will use the image's larger dimension and scale it to fit and then add white space equally to both sides or top and bottom equally to the smaller dimension.</p> <p>None will scale both image dimensions to fit the entered values un-proportionally.</p> <p><strong>NOTE: </strong>Changes will only be applied to images uploaded after the change was saved. This will not affect images uploaded previously.</p> <p><strong>Default Values: </strong>Quality: 80%; Width: 225px; Height: 150px; Crop</p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="image_entry_x">Width</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgEntryX() ?>" id="image_entry_x" name="settings[image][entry][x]"/>px </td> </tr> <tr valign="top"> <th scope="row"> <label for="image_entry_y">Height</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgEntryY() ?>" id="image_entry_y" name="settings[image][entry][y]"/>px </td> </tr> <tr valign="top"> <th scope="row"> Crop </th> <td> <?php echo $form->buildRadio('settings[image][entry][crop]', 'image_entry_crop', array('Crop (maintain aspect ratio)' => 'crop', 'Shrink (maintain aspect ratio)' => 'fill', 'None' => 'none'), $connections->options->getImgEntryCrop()); ?> </td> </tr> </tbody> </table> </div> <div class="form-field connectionsform"> <h3>Profile Image Settings</h3> <table class="form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="image_profile_quality">JPEG Quality</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgProfileQuality() ?>" id="image_profile_quality" name="settings[image][profile][quality]"/>% </td> <td rowspan="4" width="50%"> <p>Changing the Quality setting will affect the image quality as well the file size. If you require smaller file sizes and can accept lower image quality, reduce the value.</p> <p>The values entered for the width and height will be the final size of the image. If the image is smaller, white space will be added to the image with the image centered. If the image is larger in either dimension it will be scaled down. The crop setting defines how the image will be scaled down.</p> <p>Crop will use the image's smaller dimension and scale it to fit and then crop the excess image from both sides or top and bottom equally of the larger dimension.</p> <p>Shrink will use the image's larger dimension and scale it to fit and then add white space equally to both sides or top and bottom equally to the smaller dimension.</p> <p>None will scale both image dimensions to fit the entered values un-proportionally.</p> <p><strong>NOTE: </strong>Changes will only be applied to images uploaded after the change was saved. This will not affect images uploaded previously.</p> <p><strong>Default Values: </strong>Quality: 80%; Width: 300px; Height: 225px; Crop</p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="image_profile_x">Width</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgProfileX() ?>" id="image_profile_x" name="settings[image][profile][x]"/>px </td> </tr> <tr valign="top"> <th scope="row"> <label for="image_profile_y">Height</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgProfileY() ?>" id="image_profile_y" name="settings[image][profile][y]"/>px </td> </tr> <tr valign="top"> <th scope="row"> Crop </th> <td> <?php echo $form->buildRadio('settings[image][profile][crop]', 'image_profile_crop', array('Crop (maintain aspect ratio)' => 'crop', 'Shrink (maintain aspect ratio)' => 'fill', 'None' => 'none'), $connections->options->getImgProfileCrop()); ?> </td> </tr> </tbody> </table> </div> <div class="form-field connectionsform"> <h3>Logo Image Settings</h3> <table class="form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="logo_thumbnail_quality">JPEG Quality</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgLogoQuality() ?>" id="logo_thumbnail_quality" name="settings[image][logo][quality]"/>% </td> <td rowspan="4" width="50%"> <p>Changing the Quality setting will affect the image quality as well the file size. If you require smaller file sizes and can accept lower image quality, reduce the value.</p> <p>The values entered for the width and height will be the final size of the image. If the image is smaller, white space will be added to the image with the image centered. If the image is larger in either dimension it will be scaled down. The crop setting defines how the image will be scaled down.</p> <p>Crop will use the image's smaller dimension and scale it to fit and then crop the excess image from both sides or top and bottom equally of the larger dimension.</p> <p>Shrink will use the image's larger dimension and scale it to fit and then add white space equally to both sides or top and bottom equally to the smaller dimension.</p> <p>None will scale both image dimensions to fit the entered values un-proportionally.</p> <p><strong>NOTE: </strong>Although these options are available they are not recommended to be changed.</p> <p><strong>NOTE: </strong>Changes will only be applied to images uploaded after the change was saved. This will not affect images uploaded previously.</p> <p><strong>Default Values: </strong>Quality: 80%; Width: 225px; Height: 150px; Crop</p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="logo_x">Width</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgLogoX() ?>" id="logo_x" name="settings[image][logo][x]"/>px </td> </tr> <tr valign="top"> <th scope="row"> <label for="logo_y">Height</label> </th> <td> <input type="text" class="small-text" value="<?php echo $connections->options->getImgLogoY() ?>" id="logo_y" name="settings[image][logo][y]"/>px </td> </tr> <tr valign="top"> <th scope="row"> Crop </th> <td> <?php echo $form->buildRadio('settings[image][logo][crop]', 'logo_crop', array('Crop (maintain aspect ratio)' => 'crop', 'Shrink (maintain aspect ratio)' => 'fill', 'None' => 'none'), $connections->options->getImgLogoCrop()); ?> </td> </tr> </tbody> </table> </div> </div> <p class="submit"><input class="button-primary" type="submit" value="Save Changes" name="save" /></p> <?php $form->close(); ?> </div> <div class="clear"></div> <?php } }
function connectionsShowTemplatesPage() { /* * Check whether user can edit Settings */ if (!current_user_can('connections_manage_template')) { wp_die('<p id="error-page" style="-moz-background-clip:border; -moz-border-radius:11px; background:#FFFFFF none repeat scroll 0 0; border:1px solid #DFDFDF; color:#333333; display:block; font-size:12px; line-height:18px; margin:25px auto 20px; padding:1em 2em; text-align:center; width:700px">' . __('You do not have sufficient permissions to access this page.', 'connections') . '</p>'); } else { global $connections; // Purge the transient so the page is freshly scanned by the template API. delete_transient('cn_legacy_templates'); // cnTemplateFactory::$templates = new stdClass(); cnTemplateFactory::registerLegacy(); $form = new cnFormObjects(); $type = isset($_GET['type']) ? esc_attr($_GET['type']) : 'all'; $template = cnTemplateFactory::getCatalog($type); ?> <div class="wrap"> <?php echo get_screen_icon('connections'); ?> <h2>Connections : <?php _e('Templates', 'connections'); ?> <a class="button add-new-h2" href="http://connections-pro.com/templates/" target="_blank"><?php _e('Get More', 'connections'); ?> </a></h2> <ul class="subsubsub"> <li><a <?php if ($type === 'all') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=all"><?php _e('All', 'connections'); ?> </a> | </li> <li><a <?php if ($type === 'individual') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=individual"><?php _e('Individual', 'connections'); ?> </a> | </li> <li><a <?php if ($type === 'organization') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=organization"><?php _e('Organization', 'connections'); ?> </a> | </li> <li><a <?php if ($type === 'family') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=family"><?php _e('Family', 'connections'); ?> </a> | </li> <li><a <?php if ($type === 'anniversary') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=anniversary"><?php _e('Anniversary', 'connections'); ?> </a> | </li> <li><a <?php if ($type === 'birthday') { echo 'class="current" '; } ?> href="admin.php?page=connections_templates&type=birthday"><?php _e('Birthday', 'connections'); ?> </a></li> </ul> <br class="clear"> <table cellspacing="0" cellpadding="0" id="currenttheme"> <tbody> <tr> <td class="current_template"> <h2><?php _e('Current Template', 'connections'); ?> </h2> <div id="current-template"> <?php $slug = $connections->options->getActiveTemplate($type); $activeTemplate = cnTemplateFactory::getTemplate($slug); // var_dump( $activeTemplate ); if ($activeTemplate) { if ($activeTemplate->getThumbnail()) { $thumbnail = $activeTemplate->getThumbnail(); if (!empty($thumbnail['name'])) { echo '<div class="center-thumbnail"><img class="template-thumbnail" src="', $thumbnail['url'], '" /></div>'; } else { echo '<div class="center-thumbnail"><div class="template-thumbnail-none">', __('Thumbnail Not Available', 'connections'), '</div></div>'; } } if ($activeTemplate->getAuthorURL()) { $author = '<a title="' . __('Visit author\'s homepage.', 'connections') . '" href="' . $activeTemplate->getAuthorURL() . '">' . $activeTemplate->getAuthor() . '</a>'; } else { $author = $activeTemplate->getAuthor(); } echo '<h3>', $activeTemplate->getName(), ' ', $activeTemplate->getVersion(), ' by ', $author, '</h3>'; echo '<p class="theme-description">', $activeTemplate->getDescription(), '</p>'; // Remove the current template so it does not show in the available templates. unset($template->{$activeTemplate->getSlug()}); } else { echo '<h3 class="error"> Template ', esc_attr($slug), ' can not be found.</h3>'; } ?> </div> <div class="clear"></div> </td> <td class="template_instructions" colspan="2"> <p><strong><?php _e('Instructions', 'connections'); ?> :</strong></p> <p> <?php _e('By default the <code><a href="http://connections-pro.com/documentation/connections/shortcodes/shortcode-connections/">[connections]</a></code> shortcode will show all entries types. To change the template used when displaying all entry types, select the "All" tab and activate the template. When the <code><a href="http://connections-pro.com/documentation/connections/shortcodes/shortcode-connections/list_type/">list_type</a></code>shortcode option is used to filter the entries based on the entry type, the template for that entry type will be used. To change the template used for a specific entry type, select the appropriate tab and then activate the template. If multiple entry types are specified in the <code><a href="http://connections-pro.com/documentation/connections/shortcodes/shortcode-connections/list_type/">list_type</a></code> shortcode option, the template for the entry type listed first will be used to display the entry list.', 'connections'); ?> </p> <p> <?php _e('The <code><a href="http://connections-pro.com/documentation/connections/shortcodes/shortcode-upcoming-list/">[upcoming_list]</a></code> shortcode which displays the upcoming anniversaries and birthdays will be displayed with the template that is activated under their respective tabs.', 'connections'); ?> </p> <p> <?php _e('The current active template for each template type can be overridden by using the <code><a href="http://connections-pro.com/documentation/connections/shortcodes/shortcode-connections/template-option/">template</a></code> shortcode option.', 'connections'); ?> </p> </td> </tr> </tbody> </table> <table cellspacing="0" cellpadding="0" id="availablethemes"> <tbody> <tr> <td class="current_template" colspan="3"> <h2><?php _e('Available Templates', 'connections'); ?> </h2> </td> </tr> <?php $slugs = array_keys((array) $template); natcasesort($slugs); $table = array(); $rows = ceil(count($slugs) / 3); for ($row = 1; $row <= $rows; $row++) { for ($col = 1; $col <= 3; $col++) { $table[$row][$col] = array_shift($slugs); } } foreach ($table as $row => $cols) { ?> <tr> <?php foreach ($cols as $col => $slug) { $activateTokenURL = ''; $deleteTokenURL = ''; $class = array('available-theme'); if ($row == 1) { $class[] = 'top'; } if ($row == $rows) { $class[] = 'bottom'; } if ($col == 1) { $class[] = 'left'; } if ($col == 3) { $class[] = 'right'; } ?> <td class="<?php echo join(' ', $class); ?> "> <?php if (!isset($template->{$slug})) { continue; } // var_dump( $template->{ $slug } ); if ($template->{$slug}->getThumbnail()) { $thumbnail = $template->{$slug}->getThumbnail(); if (!empty($thumbnail['name'])) { echo '<div class="center-thumbnail"><img class="template-thumbnail" src="', $thumbnail['url'], '" width="300" height="225"></div>'; } else { echo '<div class="center-thumbnail"><div class="template-thumbnail-none" style="width: 300px; height: 225px"><p>', __('Thumbnail Not Available', 'connections'), '</p></div></div>'; } } if ($template->{$slug}->getAuthorURL()) { $author = '<a title="Visit author\'s homepage." href="' . $template->{$slug}->getAuthorURL() . '">' . $template->{$slug}->getAuthor() . '</a>'; } else { $author = $template->{$slug}->getAuthor(); } echo '<h3>', $template->{$slug}->getName(), ' ', $template->{$slug}->getVersion(), ' by ', $author, '</h3>'; echo '<p class="description">', $template->{$slug}->getDescription(), '</p>'; echo '<p>', __('Shortcode Override:', 'connections'), '<code> template="', $slug, '"</code></p>'; ?> <span class="action-links"> <?php $activateTokenURL = $form->tokenURL('admin.php?cn-action=activate_template&type=' . $type . '&template=' . $template->{$slug}->getSlug(), 'activate_' . $template->{$slug}->getSlug()); if ($template->{$slug}->isCustom() === TRUE && $template->{$slug}->isLegacy() === TRUE) { $deleteTokenURL = $form->tokenURL('admin.php?cn-action=delete_template&type=' . $type . '&template=' . $template->{$slug}->getSlug(), 'delete_' . $template->{$slug}->getSlug()); } ?> <a class="button-primary" href="<?php echo esc_attr($activateTokenURL); ?> " title="Activate '<?php echo esc_attr($template->{$slug}->getName()); ?> '"><?php _e('Activate', 'connections'); ?> </a> <?php if (!empty($deleteTokenURL)) { ?> | <a class="button button-warning" href="<?php echo esc_attr($deleteTokenURL); ?> " title="Delete '<?php echo esc_attr($template->{$slug}->getName()); ?> '" onclick="return confirm('You are about to delete this theme \'<?php echo esc_attr($template->{$slug}->getName()); ?> \'\n \'Cancel\' to stop, \'OK\' to delete.');">Delete</a> <?php } ?> </span> <?php if ($template->{$slug}->isCustom() === FALSE) { echo '<p class="description">', __('This a core template and can not be deleted.', 'connections'), '</p>'; } else { if ($template->{$slug}->isCustom() === TRUE && $template->{$slug}->isLegacy() === FALSE) { echo '<p class="description">', __('This template is a plugin. You can deactivate and delete the template from the Plugins admin page.', 'connections'), '</p>'; } } } ?> </td> </tr> <?php } ?> </tbody> </table> <?php if (file_exists(CN_CUSTOM_TEMPLATE_PATH) && is_writeable(CN_CUSTOM_TEMPLATE_PATH)) { ?> <table cellspacing="0" cellpadding="0" id="installthemes"> <tbody> <tr> <td class="install_template" colspan="3"> <h2><?php _e('Install Legacy Template', 'connections'); ?> </h2> <p><?php printf(__("If you puchased your template after 3.25.2013, please follow these <a href='%s'>installation instructions</a>. If you are upgrading your template purchased prior to 3.25.2013, please take note of the special upgrade instructions found on the same page.", 'connections'), 'http://connections-pro.com/documentation/plugin/install/templates/'); ?> </p> <?php $formAttr = array('action' => '', 'method' => 'post', 'enctype' => 'multipart/form-data'); $form->open($formAttr); $form->tokenField('install_template'); ?> <p> <input type="hidden" name="cn-action" value="install_template"/> <label for='template'><?php _e('Select Template:', 'connections'); ?> <input type='file' value='' name='template' size='25' /> </label> <input type="submit" value="<?php _e('Install Now', 'connections'); ?> " class="button"> </p> <?php $form->close(); ?> </td> </tr> </tbody> </table> <?php } ?> </div> <?php } }
function connectionsShowCategoriesPage() { /* * Check whether user can edit categories. */ if (!current_user_can('connections_edit_categories')) { wp_die('<p id="error-page" style="-moz-background-clip:border; -moz-border-radius:11px; background:#FFFFFF none repeat scroll 0 0; border:1px solid #DFDFDF; color:#333333; display:block; font-size:12px; line-height:18px; margin:25px auto 20px; padding:1em 2em; text-align:center; width:700px">' . __('You do not have sufficient permissions to access this page.', 'connections') . '</p>'); } else { // Grab an instance of the Connections object. $instance = Connections_Directory(); $form = new cnFormObjects(); $taxonomy = 'category'; $action = ''; if (isset($_GET['cn-action'])) { $action = $_GET['cn-action']; } if ($action === 'edit_category') { $id = absint($_GET['id']); check_admin_referer('category_edit_' . $id); $term = $instance->retrieve->category($id); $category = new cnCategory($term); /** * Fires before the Edit Term form for all taxonomies. * * The dynamic portion of the hook name, `$taxonomy`, refers to * the taxonomy slug. * * @since 3.0.0 * * @param object $tag Current taxonomy term object. * @param string $taxonomy Current $taxonomy slug. */ do_action("cn_{$taxonomy}_pre_edit_form", $term, $taxonomy); ?> <div class="wrap"> <div class="form-wrap" style="width:600px; margin: 0 auto;"> <h2><a name="new"></a><?php _e('Edit Category', 'connections'); ?> </h2> <?php $attr = array('action' => '', 'method' => 'post', 'id' => 'addcat', 'name' => 'updatecategory'); $form->open($attr); $form->tokenField('update_category'); /** * Fires inside the Edit Term form tag. * * The dynamic portion of the hook name, `$taxonomy`, refers to * the taxonomy slug. * * @since 3.7.0 */ do_action("cn_{$taxonomy}_term_edit_form_tag"); ?> <div class="form-field form-required term-name-wrap"> <label for="category_name"><?php _e('Name', 'connections'); ?> </label> <input type="text" aria-required="true" size="40" value="<?php echo esc_attr($category->getName()); ?> " id="category_name" name="category_name"/> <input type="hidden" value="<?php echo esc_attr($category->getID()); ?> " id="category_id" name="category_id"/> <p><?php _e('The name is how it appears on your site.', 'connections'); ?> </p> </div> <div class="form-field term-slug-wrap"> <label for="category_slug"><?php _e('Slug', 'connections'); ?> </label> <input type="text" size="40" value="<?php echo esc_attr($category->getSlug()); ?> " id="category_slug" name="category_slug"/> <p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'connections'); ?> </p> </div> <div class="form-field term-parent-wrap"> <label for="category_parent"><?php _e('Parent', 'connections'); ?> </label> <?php cnTemplatePart::walker('term-select', array('hide_empty' => 0, 'hide_if_empty' => FALSE, 'name' => 'category_parent', 'orderby' => 'name', 'taxonomy' => 'category', 'selected' => $category->getParent(), 'exclude_tree' => $category->getID(), 'hierarchical' => TRUE, 'show_option_none' => __('None', 'connections'))); ?> <p><?php _e('Categories can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.', 'connections'); ?> </p> </div> <div class="form-field term-description-wrap"> <?php ob_start(); /* * Now we're going to have to keep track of which TinyMCE plugins * WP core supports based on version, sigh. */ if (version_compare($GLOBALS['wp_version'], '3.8.999', '<')) { $tinymcePlugins = array('inlinepopups', 'tabfocus', 'paste', 'wordpress', 'wplink', 'wpdialogs'); } else { $tinymcePlugins = array('tabfocus', 'paste', 'wordpress', 'wplink', 'wpdialogs'); } wp_editor(wp_kses_post($category->getDescription()), 'category_description', array('media_buttons' => FALSE, 'tinymce' => array('editor_selector' => 'tinymce', 'toolbar1' => 'bold, italic, underline, |, bullist, numlist, |, justifyleft, justifycenter, justifyright, alignleft, aligncenter, alignright, |, link, unlink, |, pastetext, pasteword, removeformat, |, undo, redo', 'toolbar2' => '', 'inline_styles' => TRUE, 'relative_urls' => FALSE, 'remove_linebreaks' => FALSE, 'plugins' => implode(',', $tinymcePlugins)))); echo ob_get_clean(); ?> </div> <?php /** * Fires after the Edit Term form fields are displayed. * * The dynamic portion of the hook name, `$taxonomy`, refers to * the taxonomy slug. * * @since 3.0.0 * * @param object $tag Current taxonomy term object. * @param string $taxonomy Current taxonomy slug. */ do_action("cn_{$taxonomy}_edit_form_fields", $term, $taxonomy); /** * Fires at the end of the Edit Term form for all taxonomies. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * @since 3.0.0 * * @param object $tag Current taxonomy term object. * @param string $taxonomy Current taxonomy slug. */ do_action("{$taxonomy}_edit_form", $term, $taxonomy); ?> <input type="hidden" name="cn-action" value="update_category"/> <p class="submit"> <a class="button button-warning" href="admin.php?page=connections_categories"><?php _e('Cancel', 'connections'); ?> </a> <input type="submit" name="update" id="update" class="button button-primary" value="<?php _e('Update Category', 'connections'); ?> "/> </p> <?php $form->close(); ?> </div> </div> <?php } else { /** * @var CN_Terms_List_Table $table */ $table = cnTemplatePart::table('term-admin', array('screen' => get_current_screen()->id)); $table->prepare_items(); ?> <div class="wrap nosubsub"> <h2>Connections : <?php _e('Categories', 'connections'); ?> </h2> <form class="search-form" action="" method="get"> <input type="hidden" name="page" value="<?php echo esc_attr($_REQUEST['page']); ?> "/> <?php $table->search_box(__('Search Categories', 'connections'), 'category'); ?> </form> <br class="clear"/> <div id="col-container"> <div id="col-right"> <div class="col-wrap"> <?php $attr = array('action' => '', 'method' => 'post'); $form->open($attr); //$form->tokenField( 'bulk_delete_category' ); ?> <input type="hidden" name="cn-action" value="category_bulk_actions"/> <?php $table->display(); $form->close(); ?> <br class="clear" /> <script type="text/javascript"> /* <![CDATA[ */ (function ($) { $(document).ready(function () { $('#doaction, #doaction2').click(function () { if ($('select[name^="action"]').val() == 'delete') { var m = 'You are about to delete the selected category(ies).\n \'Cancel\' to stop, \'OK\' to delete.'; return showNotice.warn(m); } }); }); })(jQuery); /* ]]> */ </script> <div class="form-wrap"> <p><?php _e('<strong>Note:</strong><br/>Deleting a category which has been assigned to an entry will reassign that entry as <strong>Uncategorized</strong>.', 'connections'); ?> </p> </div> <?php /** * Fires after the taxonomy list table. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * @since 3.0.0 * * @param string $taxonomy The taxonomy name. */ do_action("cn_after-{$taxonomy}-table", $taxonomy); ?> </div> </div> <!-- right column --> <div id="col-left"> <div class="col-wrap"> <?php /** * Fires before the Add Term form for all taxonomies. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * @since 3.0.0 * * @param string $taxonomy The taxonomy slug. */ do_action("cn_{$taxonomy}_pre_add_form", $taxonomy); ?> <div class="form-wrap"> <h3><?php _e('Add New Category', 'connections'); ?> </h3> <?php $attr = array('action' => '', 'method' => 'post'); $form->open($attr); $form->tokenField('add_category'); /** * Fires at the beginning of the Add Tag form. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * @since 3.7.0 */ do_action("cn_{$taxonomy}_term_new_form_tag"); ?> <div class="form-field form-required term-name-wrap"> <label for="category_name"><?php _e('Name', 'connections'); ?> </label> <input type="text" aria-required="true" size="40" value="" id="category_name" name="category_name"/> <input type="hidden" value="" id="category_id" name="category_id"/> <p><?php _e('The name is how it appears on your site.', 'connections'); ?> </p> </div> <div class="form-field term-slug-wrap"> <label for="category_slug"><?php _e('Slug', 'connections'); ?> </label> <input type="text" size="40" value="" id="category_slug" name="category_slug"/> <p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'connections'); ?> </p> </div> <div class="form-field term-parent-wrap"> <label for="category_parent"><?php _e('Parent', 'connections'); ?> </label> <?php $dropdown_args = array('hide_empty' => 0, 'hide_if_empty' => FALSE, 'taxonomy' => 'category', 'name' => 'category_parent', 'orderby' => 'name', 'hierarchical' => TRUE, 'show_option_none' => __('None', 'connections')); /** * Filter the taxonomy parent drop-down on the Edit Term page. * * @since 3.7.0 * * @param array $dropdown_args { * An array of taxonomy parent drop-down arguments. * * @type int|bool $hide_empty Whether to hide terms not attached to any posts. Default 0|false. * @type bool $hide_if_empty Whether to hide the drop-down if no terms exist. Default false. * @type string $taxonomy The taxonomy slug. * @type string $name Value of the name attribute to use for the drop-down select element. * Default 'parent'. * @type string $orderby The field to order by. Default 'name'. * @type bool $hierarchical Whether the taxonomy is hierarchical. Default true. * @type string $show_option_none Label to display if there are no terms. Default 'None'. * } * * @param string $taxonomy The taxonomy slug. */ $dropdown_args = apply_filters('cn_taxonomy_parent_dropdown_args', $dropdown_args, 'category'); cnTemplatePart::walker('term-select', $dropdown_args); ?> <p><?php _e('Categories can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.', 'connections'); ?> </p> </div> <div class="form-field term-description-wrap"> <?php ob_start(); /* * Now we're going to have to keep track of which TinyMCE plugins * WP core supports based on version, sigh. */ if (version_compare($GLOBALS['wp_version'], '3.8.999', '<')) { $tinymcePlugins = array('inlinepopups', 'tabfocus', 'paste', 'wordpress', 'wplink', 'wpdialogs'); } else { $tinymcePlugins = array('tabfocus', 'paste', 'wordpress', 'wplink', 'wpdialogs'); } wp_editor('', 'category_description', array('media_buttons' => FALSE, 'tinymce' => array('editor_selector' => 'tinymce', 'toolbar1' => 'bold, italic, underline, |, bullist, numlist, |, justifyleft, justifycenter, justifyright, alignleft, aligncenter, alignright, |, link, unlink, |, pastetext, pasteword, removeformat, |, undo, redo', 'toolbar2' => '', 'inline_styles' => TRUE, 'relative_urls' => FALSE, 'remove_linebreaks' => FALSE, 'plugins' => implode(',', $tinymcePlugins)))); echo ob_get_clean(); ?> </div> <input type="hidden" name="cn-action" value="add_category"/> <?php /** * Fires after the Add Term form fields for hierarchical taxonomies. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * @since 3.0.0 * * @param string $taxonomy The taxonomy slug. */ do_action("cn_{$taxonomy}_add_form_fields", $taxonomy); submit_button(__('Add New Category', 'connections'), 'primary', 'add'); /** * Fires at the end of the Add Term form for all taxonomies. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * @since 3.0.0 * * @param string $taxonomy The taxonomy slug. */ do_action("cn_{$taxonomy}_add_form", $taxonomy); ?> <?php $form->close(); ?> </div> </div> </div> <!-- left column --> </div> <!-- Column container --> </div> <?php } } }
function connectionsShowViewPage() { global $wpdb, $connections; if (isset($_GET['action'])) { $action = $_GET['action']; } else { $action = NULL; } ?> <div class="wrap"> <div class="icon32" id="icon-connections"><br/></div> <h2>Connections</h2> <?php $connections->displayMessages(); switch ($action) { case 'add_new': /* * Check whether current user can add an entry. */ if (current_user_can('connections_add_entry')) { add_meta_box('metabox-name', 'Name', array(&$form, 'metaboxName'), $connections->pageHook->manage, 'normal', 'high'); $form = new cnFormObjects(); $entry = new cnEntry(); echo '<div id="poststuff" class="metabox-holder has-right-sidebar">'; echo '<h2><a name="new"></a>Add Entry</h2>'; $attr = array('action' => 'admin.php?page=connections&action=add', 'method' => 'post', 'enctype' => 'multipart/form-data'); $form->open($attr); $form->tokenField('add_entry'); wp_nonce_field('howto-metaboxes-general'); wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); echo '<input type="hidden" name="action" value="save_howto_metaboxes_general" />'; echo '<div id="side-info-column" class="inner-sidebar">'; do_meta_boxes($connections->pageHook->manage, 'side', $entry); echo '</div>'; echo '<div id="post-body" class="has-sidebar">'; echo '<div id="post-body-content" class="has-sidebar-content">'; do_meta_boxes($connections->pageHook->manage, 'normal', $entry); echo '</div>'; echo '</div>'; $form->close(); echo '</div>'; ?> <script type="text/javascript"> //<![CDATA[ jQuery(document).ready( function($) { // close postboxes that should be closed $('.if-js-closed').removeClass('if-js-closed').addClass('closed'); // postboxes setup postboxes.add_postbox_toggles('<?php echo $connections->pageHook->manage; ?> '); }); //]]> </script> <?php unset($entry); } else { $connections->setErrorMessage('capability_add'); } break; case 'copy': /* * Check whether current user can add an entry. */ if (current_user_can('connections_add_entry')) { $id = esc_attr($_GET['id']); check_admin_referer('entry_copy_' . $id); add_meta_box('metabox-name', 'Name', array(&$form, 'metaboxName'), $connections->pageHook->manage, 'normal', 'high'); $form = new cnFormObjects(); $entry = new cnEntry($connections->retrieve->entry($id)); echo '<div id="poststuff" class="metabox-holder has-right-sidebar">'; echo '<h2><a name="new"></a>Add Entry</h2>'; $attr = array('action' => 'admin.php?page=connections&action=add&id=' . $id, 'method' => 'post', 'enctype' => 'multipart/form-data'); $form->open($attr); $form->tokenField('add_entry'); wp_nonce_field('howto-metaboxes-general'); wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); echo '<input type="hidden" name="action" value="save_howto_metaboxes_general" />'; echo '<div id="side-info-column" class="inner-sidebar">'; do_meta_boxes($connections->pageHook->manage, 'side', $entry); echo '</div>'; echo '<div id="post-body" class="has-sidebar">'; echo '<div id="post-body-content" class="has-sidebar-content">'; do_meta_boxes($connections->pageHook->manage, 'normal', $entry); echo '</div>'; echo '</div>'; $form->close(); echo '</div>'; ?> <script type="text/javascript"> //<![CDATA[ jQuery(document).ready( function($) { // close postboxes that should be closed $('.if-js-closed').removeClass('if-js-closed').addClass('closed'); // postboxes setup postboxes.add_postbox_toggles('<?php echo $connections->pageHook->manage; ?> '); }); //]]> </script> <?php unset($entry); } else { $connections->setErrorMessage('capability_add'); } break; case 'edit': /* * Check whether the current user can edit entries. */ if (current_user_can('connections_edit_entry')) { $id = esc_attr($_GET['id']); check_admin_referer('entry_edit_' . $id); add_meta_box('metabox-name', 'Name', array(&$form, 'metaboxName'), $connections->pageHook->manage, 'normal', 'high'); $form = new cnFormObjects(); $entry = new cnEntry($connections->retrieve->entry($id)); echo '<div id="poststuff" class="metabox-holder has-right-sidebar">'; echo '<h2><a name="new"></a>Edit Entry</h2>'; $attr = array('action' => 'admin.php?page=connections&action=update&id=' . $id, 'method' => 'post', 'enctype' => 'multipart/form-data'); $form->open($attr); $form->tokenField('update_entry'); wp_nonce_field('howto-metaboxes-general'); wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); echo '<input type="hidden" name="action" value="save_howto_metaboxes_general" />'; echo '<div id="side-info-column" class="inner-sidebar">'; do_meta_boxes($connections->pageHook->manage, 'side', $entry); echo '</div>'; echo '<div id="post-body" class="has-sidebar">'; echo '<div id="post-body-content" class="has-sidebar-content">'; do_meta_boxes($connections->pageHook->manage, 'normal', $entry); echo '</div>'; echo '</div>'; $form->close(); echo '</div>'; ?> <script type="text/javascript"> //<![CDATA[ jQuery(document).ready( function($) { // close postboxes that should be closed $('.if-js-closed').removeClass('if-js-closed').addClass('closed'); // postboxes setup postboxes.add_postbox_toggles('<?php echo $connections->pageHook->manage; ?> '); }); //]]> </script> <?php unset($entry); } else { $connections->setErrorMessage('capability_edit'); } break; default: $form = new cnFormObjects(); $categoryObjects = new cnCategoryObjects(); /* * Check whether user can view the entry list */ if (current_user_can('connections_view_entry_list')) { ?> <?php $retrieveAttr['list_type'] = $connections->currentUser->getFilterEntryType(); $retrieveAttr['category'] = $connections->currentUser->getFilterCategory(); $retrieveAttr['visibility'] = $connections->currentUser->getFilterVisibility(); $results = $connections->retrieve->entries($retrieveAttr); //print_r($connections->lastQuery); ?> <form action="admin.php?page=connections&action=do" method="post"> <?php $form->tokenField('bulk_action'); ?> <div class="tablenav"> <div class="alignleft actions"> <?php echo '<select class="postform" id="category" name="category">'; echo '<option value="-1">Show All Categories</option>'; echo $categoryObjects->buildCategoryRow('option', $connections->retrieve->categories(), $level, $connections->currentUser->getFilterCategory()); echo '</select>'; echo $form->buildSelect('entry_type', array('all' => 'Show All Enties', 'individual' => 'Show Individuals', 'organization' => 'Show Organizations', 'family' => 'Show Families'), $connections->currentUser->getFilterEntryType()); ?> <?php /* * Builds the visibilty select list base on current user capabilities. */ if (current_user_can('connections_view_public') || $connections->options->getAllowPublic()) { $visibilitySelect['public'] = 'Show Public'; } if (current_user_can('connections_view_private')) { $visibilitySelect['private'] = 'Show Private'; } if (current_user_can('connections_view_unlisted')) { $visibilitySelect['unlisted'] = 'Show Unlisted'; } if (isset($visibilitySelect)) { /* * Add the 'Show All' option and echo the list. */ $showAll['all'] = 'Show All'; $visibilitySelect = $showAll + $visibilitySelect; echo $form->buildSelect('visibility_type', $visibilitySelect, $connections->currentUser->getFilterVisibility()); } ?> <input id="doaction" class="button-secondary action" type="submit" name="filter" value="Filter" /> <input type="hidden" name="formId" value="do_action" /> <input type="hidden" name="token" value="<?php echo $form->token("do_action"); ?> " /> </div> </div> <div class="clear"></div> <div class="tablenav"> <?php if (current_user_can('connections_edit_entry') || current_user_can('connections_delete_entry')) { echo '<div class="alignleft actions">'; echo '<select name="action">'; echo '<option value="" SELECTED>Bulk Actions</option>'; $bulkActions = array(); if (current_user_can('connections_edit_entry')) { $bulkActions['public'] = 'Set Public'; $bulkActions['private'] = 'Set Private'; $bulkActions['unlisted'] = 'Set Unlisted'; } if (current_user_can('connections_delete_entry')) { $bulkActions['delete'] = 'Delete'; } $bulkActions = apply_filters('cn_view_bulk_actions', $bulkActions); foreach ($bulkActions as $action => $string) { echo '<option value="', $action, '">', $string, '</option>'; } echo '</select>'; echo '<input id="doaction" class="button-secondary action" type="submit" name="doaction" value="Apply" />'; echo '</div>'; } ?> <div class="tablenav-pages"> <?php echo '<span class="displaying-num">Displaying ', $connections->resultCount, ' of ', $connections->recordCount, ' records.</span>'; /* * Dynamically builds the alpha index based on the available entries. */ $previousLetter = NULL; $setAnchor = NULL; foreach ($results as $row) { $entry = new cnEntry($row); $currentLetter = strtoupper(mb_substr($entry->getSortColumn(), 0, 1)); if ($currentLetter != $previousLetter) { $setAnchor .= '<a href="#' . $currentLetter . '">' . $currentLetter . '</a> '; $previousLetter = $currentLetter; } } echo $setAnchor; ?> </div> </div> <div class="clear"></div> <table cellspacing="0" class="widefat connections"> <thead> <tr> <th class="manage-column column-cb check-column" id="cb" scope="col"><input type="checkbox"/></th> <th class="col" style="width:10%;"></th> <th scope="col" colspan="2" style="width:40%;">Name</th> <th scope="col" style="width:30%;">Categories</th> <th scope="col" style="width:20%;">Last Modified</th> </tr> </thead> <tfoot> <tr> <th class="manage-column column-cb check-column" scope="col"><input type="checkbox"/></th> <th class="col" style="width:10%;"></th> <th scope="col" colspan="2" style="width:40%;">Name</th> <th scope="col" style="width:30%;">Categories</th> <th scope="col" style="width:20%;">Last Modified</th> </tr> </tfoot> <tbody> <?php foreach ($results as $row) { /** * @TODO: Use the Output class to show entry details. */ $entry = new cnvCard($row); $vCard =& $entry; $currentLetter = strtoupper(mb_substr($entry->getSortColumn(), 0, 1)); if ($currentLetter != $previousLetter) { $setAnchor = "<a name='{$currentLetter}'></a>"; $previousLetter = $currentLetter; } else { $setAnchor = null; } /* * Genreate the edit, copy and delete URLs with nonce tokens. */ $editTokenURL = $form->tokenURL('admin.php?page=connections&action=edit&id=' . $entry->getId(), 'entry_edit_' . $entry->getId()); $copyTokenURL = $form->tokenURL('admin.php?page=connections&action=copy&id=' . $entry->getId(), 'entry_copy_' . $entry->getId()); $deleteTokenURL = $form->tokenURL('admin.php?page=connections&action=delete&id=' . $entry->getId(), 'entry_delete_' . $entry->getId()); echo "<tr id='row-" . $entry->getId() . "' class='parent-row'>"; echo "<th class='check-column' scope='row'><input type='checkbox' value='" . $entry->getId() . "' name='entry[]'/></th> \n"; echo '<td>'; echo $entry->getThumbnailImage(array('place_holder' => TRUE)); echo '</td>'; echo '<td colspan="2">'; if ($setAnchor) { echo $setAnchor; } echo '<div style="float:right"><a href="#wphead" title="Return to top."><img src="' . WP_PLUGIN_URL . '/connections/images/uparrow.gif" /></a></div>'; if (current_user_can('connections_edit_entry')) { echo '<a class="row-title" title="Edit ' . $entry->getFullFirstLastName() . '" href="' . $editTokenURL . '"> ' . $entry->getFullLastFirstName() . '</a><br />'; } else { echo '<strong>' . $entry->getFullLastFirstName() . '</strong>'; } echo '<div class="row-actions">'; echo '<a class="detailsbutton" id="row-' . $entry->getId() . '">Show Details</a> | '; echo $vCard->download(array('anchorText' => 'vCard')) . ' | '; if (current_user_can('connections_edit_entry')) { echo '<a class="editbutton" href="' . $editTokenURL . '" title="Edit ' . $entry->getFullFirstLastName() . '">Edit</a> | '; } if (current_user_can('connections_add_entry')) { echo '<a class="copybutton" href="' . $copyTokenURL . '" title="Copy ' . $entry->getFullFirstLastName() . '">Copy</a> | '; } if (current_user_can('connections_delete_entry')) { echo '<a class="submitdelete" onclick="return confirm(\'You are about to delete this entry. \\\'Cancel\\\' to stop, \\\'OK\\\' to delete\');" href="' . $deleteTokenURL . '" title="Delete ' . $entry->getFullFirstLastName() . '">Delete</a>'; } echo '</div>'; echo "</td> \n"; echo "<td > \n"; $categories = $entry->getCategory(); if (!empty($categories)) { $i = 0; foreach ($categories as $category) { /* * Genreate the category link token URL. */ $categoryFilterURL = $form->tokenURL('admin.php?page=connections&action=filter&category_id=' . $category->term_id, 'filter'); echo '<a href="' . $categoryFilterURL . '">' . $category->name . '</a>'; $i++; if (count($categories) > $i) { echo ', '; } } unset($i); } echo "</td> \n"; echo '<td >'; echo '<strong>On:</strong> ' . $entry->getFormattedTimeStamp('m/d/Y g:ia') . '<br />'; echo '<strong>By:</strong> ' . $entry->getEditedBy() . '<br />'; echo '<strong>Visibility:</strong> ' . $entry->displayVisibiltyType(); echo "</td> \n"; echo "</tr> \n"; echo "<tr class='child-row-" . $entry->getId() . " entrydetails' id='contact-" . $entry->getId() . "-detail' style='display:none;'>"; echo "<td colspan='2' > </td> \n"; //echo "<td > </td> \n"; echo "<td colspan='2'>"; /* * Check if the entry has relations. Count the relations and then cycle thru each relation. * Before the out check that the related entry still exists. If it does and the current user * has edit capabilites the edit link will be displayed. If the user does not have edit capabilities * the only the relation will be shown. After all relations have been output insert a <br> * for spacing [@TODO: NOTE: this should be done with styles]. */ if ($entry->getFamilyMembers()) { $count = count($entry->getFamilyMembers()); $i = 0; foreach ($entry->getFamilyMembers() as $key => $value) { $relation = new cnEntry(); $relation->set($key); $editRelationTokenURL = $form->tokenURL('admin.php?page=connections&action=edit&id=' . $relation->getId(), 'entry_edit_' . $relation->getId()); if ($relation->getId()) { if (current_user_can('connections_edit_entry')) { echo '<strong>' . $connections->options->getFamilyRelation($value) . ':</strong> ' . '<a href="' . $editRelationTokenURL . '" title="Edit ' . $relation->getFullFirstLastName() . '">' . $relation->getFullFirstLastName() . '</a><br />' . "\n"; } else { echo '<strong>' . $connections->options->getFamilyRelation($value) . ':</strong> ' . $relation->getFullFirstLastName() . '<br />' . "\n"; } } if ($count - 1 == $i) { echo '<br />'; } // Insert a break after all connections are listed. $i++; unset($relation); } unset($i); unset($count); } if ($entry->getContactFirstName() || $entry->getContactLastName()) { echo '<strong>Contact:</strong> ' . $entry->getContactFirstName() . ' ' . $entry->getContactLastName() . '<br />'; } if ($entry->getTitle()) { echo '<strong>Title:</strong> ' . $entry->getTitle() . '<br />'; } if ($entry->getOrganization() && $entry->getEntryType() !== 'organization') { echo '<strong>Organization:</strong> ' . $entry->getOrganization() . '<br />'; } if ($entry->getDepartment()) { echo '<strong>Department:</strong> ' . $entry->getDepartment() . '<br />'; } if ($entry->getAddresses()) { foreach ($entry->getAddresses() as $address) { echo "<div style='margin-bottom: 10px;'>"; if ($address->name != NULL || $address->type) { echo "<strong>" . $address->name . "</strong><br />"; } //The OR is for compatiblity for 0.2.24 and under if ($address->line_one != NULL) { echo $address->line_one . "<br />"; } if ($address->line_two != NULL) { echo $address->line_two . "<br />"; } if ($address->city != NULL) { echo $address->city . " "; } if ($address->state != NULL) { echo $address->state . " "; } if ($address->zipcode != NULL) { echo $address->zipcode . "<br />"; } if ($address->country != NULL) { echo $address->country; } echo "</div>"; } } echo "</td> \n"; echo "<td>"; if ($entry->getEmailAddresses()) { foreach ($entry->getEmailAddresses() as $emailRow) { if ($emailRow->address != null) { echo "<strong>" . $emailRow->name . ":</strong><br /><a href='mailto:" . $emailRow->address . "'>" . $emailRow->address . "</a><br /><br />"; } } } if ($entry->getIm()) { foreach ($entry->getIm() as $imRow) { if ($imRow->id != "") { echo "<strong>" . $imRow->name . ":</strong><br />" . $imRow->id . "<br /><br />"; } } } if ($entry->getSocialMedia()) { foreach ($entry->getSocialMedia() as $socialNetwork) { if ($socialNetwork->id != "") { echo "<strong>" . $socialNetwork->name . ":</strong><br /><a target='_blank' href='" . $socialNetwork->url . "'>" . $socialNetwork->url . "</a><br /><br />"; } } } if ($entry->getWebsites()) { foreach ($entry->getWebsites() as $website) { if ($website->url != "") { echo "<strong>Website:</strong><br /><a target='_blank' href='" . $website->url . "'>" . $website->url . "</a><br /><br />"; } } } if ($entry->getPhoneNumbers()) { foreach ($entry->getPhoneNumbers() as $phone) { if ($phone->number != "") { echo "<strong>" . $phone->name . "</strong>: " . $phone->number . "<br />"; } } } echo "</td> \n"; echo "<td>"; if ($entry->getBirthday()) { echo "<strong>Birthday:</strong><br />" . $entry->getBirthday() . "<br /><br />"; } if ($entry->getAnniversary()) { echo "<strong>Anniversary:</strong><br />" . $entry->getAnniversary(); } echo "</td> \n"; echo "</tr> \n"; echo "<tr class='child-row-" . $entry->getId() . " entrynotes' id='contact-" . $entry->getId() . "-detail-notes' style='display:none;'>"; echo "<td colspan='2'> </td> \n"; //echo "<td > </td> \n"; echo "<td colspan='3'>"; if ($entry->getBio()) { echo "<strong>Bio:</strong> " . $entry->getBio() . "<br />"; } else { echo " "; } if ($entry->getNotes()) { echo "<strong>Notes:</strong> " . $entry->getNotes(); } else { echo " "; } echo "</td> \n"; echo '<td> <strong>Entry ID:</strong> ' . $entry->getId() . '<br />' . ' <strong>Date Added:</strong> ' . $entry->getDateAdded('m/d/Y g:ia') . '<br /> <strong>Added By:</strong> ' . $entry->getAddedBy() . '<br />'; if (!$entry->getImageLinked()) { echo "<br /><strong>Image Linked:</strong> No"; } else { echo "<br /><strong>Image Linked:</strong> Yes"; } if ($entry->getImageLinked() && $entry->getImageDisplay()) { echo "<br /><strong>Display:</strong> Yes"; } else { echo "<br /><strong>Display:</strong> No"; } echo "</td> \n"; echo "</tr> \n"; } ?> </tbody> </table> </form> <p style="font-size:smaller; text-align:center">This is version <?php echo $connections->options->getVersion(), '-', $connections->options->getDBVersion(); ?> of Connections.</p> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="text-align:center"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="5070255"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> <script type="text/javascript"> /* <![CDATA[ */ (function($){ $(document).ready(function(){ $('#doaction, #doaction2').click(function(){ if ( $('select[name^="action"]').val() == 'delete' ) { var m = 'You are about to delete the selected entry(ies).\n \'Cancel\' to stop, \'OK\' to delete.'; return showNotice.warn(m); } }); }); })(jQuery); /* ]]> */ </script> <?php } else { $connections->setErrorMessage('capability_view_entry_list'); } break; } ?> </div> <?php }
function connectionsShowDashboardPage() { /* * Check whether user can view the Dashboard */ if (!current_user_can('connections_view_dashboard')) { wp_die('<p id="error-page" style="-moz-background-clip:border; -moz-border-radius:11px; background:#FFFFFF none repeat scroll 0 0; border:1px solid #DFDFDF; color:#333333; display:block; font-size:12px; line-height:18px; margin:25px auto 20px; padding:1em 2em; text-align:center; width:700px">' . __('You do not have sufficient permissions to access this page.', 'connections') . '</p>'); } else { global $connections; $form = new cnFormObjects(); ?> <div class="wrap"> <h2>Connections : <?php _e('Dashboard', 'connections'); ?> </h2> <div id="dashboard-widgets-wrap"> <div id="dashboard-widgets" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?> "> <div class="postbox-container"> <?php do_meta_boxes($connections->pageHook->dashboard, 'left', NULL); ?> </div> <div class="postbox-container"> <?php do_meta_boxes($connections->pageHook->dashboard, 'right', NULL); ?> </div> </div><!-- #dashboard-widgets --> </div><!-- .dashboard-widgets-wrap --> </div><!-- .wrap --> <?php $attr = array('action' => '', 'method' => 'get'); $form->open($attr); /* Used to save closed metaboxes and their order */ wp_nonce_field('meta-box-order', 'meta-box-order-nonce', FALSE); wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', FALSE); $form->close(); ?> <div class="clear"></div> <?php } }