Skip to content

Commit

Permalink
re adding dashboard page for theme
Browse files Browse the repository at this point in the history
  • Loading branch information
diegorojas committed Sep 17, 2017
1 parent 56975a6 commit c3677e9
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 334 deletions.
23 changes: 0 additions & 23 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
/*--------------------------------------------------------------
THEME DASHBOARD
--------------------------------------------------------------*/
.famethemes-badge {
position: absolute;
right: 0;
top: 0;
background-color: #0073aa;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAAAXNSR0IArs4c6QAAAYpJREFUeAHt2jGKA0EUxFCP8f2vPDM4VKyCDuSsEmHefifNXvf7+fRRBb5qrdhfINTBIYQa6kBgkOxSQx0IDJJdaqgDgUGySw11IDBIdqmhDgQGyS411IHAINmlhjoQGCR/RvN6P0bnhIbxaN/Pf/CXDDXUgcAg2aWGOhAYJLvUUAcCg2SXGupAYJDsUkMdCAySXWqoA4FBsksNdSAwSHapA1Tlkdr4XsbjsPE9jEaXaiiiESpAjBmqoYhGqAAxZqiGIhqhAsSYoRqKaIQKEGOGaiiiESpAjBmqoYhGqAAxZqiGIhqhAsSYoRqKaIQKEGMe80h9yn9jG4/lXapxmmiEChBjhmooohEqQIwZqqGIRqgAMWaohiIaoQLEmKEaimiEChBjhmooohEqQIwZqqGIRqgAMWaohiIaoQLEmMc8UhuPwwaI0ehSDUU0QgWIMUM1FNEIFSDGDNVQRCNUgBgzVEMRjVABYsxQDUU0QgWIMUM1FNEIFSDGDNVQRCNUgBgzVEMRjVABYswHs34UpggOW5wAAAAASUVORK5CYII=') !important;
background-position: no-repeat scroll center 24px;
background-repeat: no-repeat;
background-size: 85px 85px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
color: #78c8e6;
display: inline-block;
font-size: 14px;
font-weight: 600;
height: 40px;
margin: 5px 0 0;
padding-top: 120px;
text-align: center;
text-rendering: optimizelegibility;
width: 150px;
text-decoration: none;
}

.theme_info_wrapper p span {
margin-left: 30px;
}
Expand Down
97 changes: 1 addition & 96 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,96 +283,6 @@ function coletivo_admin_scripts( $hook ) {
endif;
add_action( 'admin_enqueue_scripts', 'coletivo_admin_scripts' );


if ( ! function_exists( 'coletivo_register_required_plugins' ) ) :
/**
* Register the required plugins for this theme.
*
* In this example, we register five plugins:
* - one included with the TGMPA library
* - two from an external source, one from an arbitrary source, one from a GitHub repository
* - two from the .org repo, where one demonstrates the use of the `is_callable` argument
*
* The variable passed to tgmpa_register_plugins() should be an array of plugin
* arrays.
*
* This function is hooked into tgmpa_init, which is fired within the
* TGM_Plugin_Activation class constructor.
*/
function coletivo_register_required_plugins() {
/*
* Array of plugin arrays. Required keys are name and slug.
* If the source is NOT from the .org repo, then source is also required.
*/
$plugins = array(
array(
'name' => 'Contact Form 7', // The plugin name.
'slug' => 'contact-form-7', // The plugin slug (typically the folder name).
'source' => '', // The plugin source.
'required' => false, // If false, the plugin is only 'recommended' instead of required.
'version' => '4.2', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '', // If set, overrides default API URL and points to an external URL.
),
);

/*
* Array of configuration settings. Amend each line as needed.
*
* TGMPA will start providing localized text strings soon. If you already have translations of our standard
* strings available, please help us make TGMPA even better by giving us access to these translations or by
* sending in a pull-request with .po file(s) with the translations.
*
* Only uncomment the strings in the config array if you want to customize the strings.
*/
$config = array(
'id' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'parent_slug' => 'themes.php', // Parent menu slug.
'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
'has_notices' => false, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => true, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.

'strings' => array(
'page_title' => esc_html__( 'Install Required Plugins', 'coletivo' ),
'menu_title' => esc_html__( 'Install Plugins', 'coletivo' ),
'installing' => esc_html__( 'Installing Plugin: %s', 'coletivo' ), // %s = plugin name.
'oops' => esc_html__( 'Something went wrong with the plugin API.', 'coletivo' ),
'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'coletivo' ), // %1$s = plugin name(s).
'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'coletivo' ), // %1$s = plugin name(s).
'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %1$s plugin.', 'Sorry, but you do not have the correct permissions to install the %1$s plugins.', 'coletivo' ), // %1$s = plugin name(s).
'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'coletivo' ), // %1$s = plugin name(s).
'notice_ask_to_update_maybe' => _n_noop( 'There is an update available for: %1$s.', 'There are updates available for the following plugins: %1$s.', 'coletivo' ), // %1$s = plugin name(s).
'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %1$s plugin.', 'Sorry, but you do not have the correct permissions to update the %1$s plugins.', 'coletivo' ), // %1$s = plugin name(s).
'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'coletivo' ), // %1$s = plugin name(s).
'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'coletivo' ), // %1$s = plugin name(s).
'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %1$s plugin.', 'Sorry, but you do not have the correct permissions to activate the %1$s plugins.', 'coletivo' ), // %1$s = plugin name(s).
'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'coletivo' ),
'update_link' => _n_noop( 'Begin updating plugin', 'Begin updating plugins', 'coletivo' ),
'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'coletivo' ),
'return' => esc_html__( 'Return to Required Plugins Installer', 'coletivo' ),
'plugin_activated' => esc_html__( 'Plugin activated successfully.', 'coletivo' ),
'activated_successfully' => esc_html__( 'The following plugin was activated successfully:', 'coletivo' ),
'plugin_already_active' => esc_html__( 'No action taken. Plugin %1$s was already active.', 'coletivo' ), // %1$s = plugin name(s).
'plugin_needs_higher_version' => esc_html__( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'coletivo' ), // %1$s = plugin name(s).
'complete' => esc_html__( 'All plugins installed and activated successfully. %1$s', 'coletivo' ), // %s = dashboard link.
'contact_admin' => esc_html__( 'Please contact the administrator of this site for help.', 'coletivo' ),
'nag_type' => 'updated', // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
),

);

tgmpa( $plugins, $config );
}

endif;
add_action( 'tgmpa_register', 'coletivo_register_required_plugins' );

/**
* Custom template tags for this theme.
*/
Expand All @@ -393,12 +303,7 @@ function coletivo_register_required_plugins() {
*/
require get_template_directory() . '/inc/customizer-update-fields.php';

/**
* Load TGM class plugin activation.
*/
// require get_template_directory() . '/inc/tgm-plugin-activation.php';

/**
* Add theme info page
*/
// require get_template_directory() . '/inc/dashboard.php';
require get_template_directory() . '/inc/dashboard.php';
17 changes: 8 additions & 9 deletions inc/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

add_action('admin_menu', 'coletivo_theme_info');
function coletivo_theme_info() {
//$theme_data = wp_get_theme('coletivo');

$actions = coletivo_get_actions_required();
$n = array_count_values( $actions );
Expand Down Expand Up @@ -63,7 +62,7 @@ function coletivo_one_activation_admin_notice(){

function coletivo_theme_info_page() {

$theme_data = wp_get_theme('coletivo');
$theme_data = wp_get_theme();

if ( isset( $_GET['coletivo_action_dismiss'] ) ) {
$actions_dismiss = get_option( 'coletivo_actions_dismiss' );
Expand Down Expand Up @@ -93,7 +92,7 @@ function coletivo_theme_info_page() {
<div class="wrap about-wrap theme_info_wrapper">
<h1><?php printf(esc_html__('Welcome to Coletivo - Version %1s', 'coletivo'), $theme_data->Version ); ?></h1>
<div class="about-text"><?php esc_html_e( 'Coletivo is a creative and flexible WordPress theme well suited for business, social projects, portfolio, digital agency, product showcase, freelancers websites.', 'coletivo' ); ?></div>
<a target="_blank" href="<?php echo esc_url('http://redelivre.org'); ?>" class="famethemes-badge wp-badge"><span>#RedeLivre</span></a>
<a target="_blank" href="<?php echo esc_url('http://tema.coletivowp.com.br'); ?>" class="wp-badge"><span>ColetivoWP</span></a>
<h2 class="nav-tab-wrapper">
<a href="?page=ft_coletivo" class="nav-tab<?php echo is_null($tab) ? ' nav-tab-active' : null; ?>"><?php esc_html_e( 'Coletivo', 'coletivo' ) ?></a>
<a href="?page=ft_coletivo&tab=actions_required" class="nav-tab<?php echo $tab == 'actions_required' ? ' nav-tab-active' : null; ?>"><?php esc_html_e( 'Actions Required', 'coletivo' ); echo ( $number_action > 0 ) ? "<span class='theme-action-count'>{$number_action}</span>" : ''; ?></a>
Expand All @@ -116,17 +115,17 @@ function coletivo_theme_info_page() {
<h3><?php esc_html_e( 'Theme Documentation', 'coletivo' ); ?></h3>
<p class="about"><?php printf(esc_html__('Need any help to setup and configure %s? Please have a look at our documentations instructions.', 'coletivo'), $theme_data->Name); ?></p>
<p>
<a href="<?php echo esc_url( 'http://docs.famethemes.com/category/42-coletivo' ); ?>" target="_blank" class="button button-secondary"><?php esc_html_e('Coletivo Documentation', 'coletivo'); ?></a>
<a href="<?php echo esc_url( 'https://github.com/redelivre/tema-coletivo/wiki/Inicial' ); ?>" target="_blank" class="button button-secondary"><?php esc_html_e('Coletivo Documentation', 'coletivo'); ?></a>
</p>
<?php do_action( 'coletivo_dashboard_theme_links' ); ?>
</div>
<div class="theme_link">
<h3><?php esc_html_e( 'Having Trouble, Need Support?', 'coletivo' ); ?></h3>
<p class="about"><?php printf(esc_html__('Support for %s WordPress theme is conducted through FameThemes support ticket system.', 'coletivo'), $theme_data->Name); ?></p>
<!-- <div class="theme_link">
<h3><?php // esc_html_e( 'Having Trouble, Need Support?', 'coletivo' ); ?></h3>
<p class="about"><?php // printf(esc_html__('Support for %s is conducted through the oficial repository support.', 'coletivo'), $theme_data->Name); ?></p>
<p>
<a href="<?php echo esc_url('https://www.famethemes.com/dashboard/tickets/' ); ?>" target="_blank" class="button button-secondary"><?php echo sprintf( esc_html('Create a support ticket', 'coletivo'), $theme_data->Name); ?></a>
<a href="<?php // echo esc_url('https://wordpress.org/plugins/' ); ?>" target="_blank" class="button button-secondary"><?php // echo sprintf( esc_html__('Ask for support', 'coletivo'), $theme_data->Name); ?></a>
</p>
</div>
</div> -->
</div>

<div class="theme_info_right">
Expand Down
19 changes: 11 additions & 8 deletions languages/en_US.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Tema Coletivo\n"
"POT-Creation-Date: 2017-09-12 01:02-0300\n"
"POT-Creation-Date: 2017-09-17 07:26-0300\n"
"PO-Revision-Date: 2016-11-09 16:07-0200\n"
"Last-Translator: Diego Rojas <diego@brasa.art.br>\n"
"Language-Team: Diego Rojas <diego@brasa.art.br>\n"
Expand Down Expand Up @@ -1482,7 +1482,7 @@ msgstr ""
#: inc/dashboard.php:112
#, fuzzy
msgid "Start Customize"
msgstr "iniciar customização"
msgstr "iniciar Personalizar"

#: inc/dashboard.php:116
#, fuzzy
Expand All @@ -1496,12 +1496,12 @@ msgid ""
"documentations instructions."
msgstr ""
"Precisa de alguma ajuda para configurar %s? Por favor dê uma olhada nas "
"instruções de nossa documentãção."
"instruções de nossa documentação."

#: inc/dashboard.php:119
#, fuzzy
msgid "Coletivo Documentation"
msgstr "Documentação do OndePress"
msgstr "Documentação do Coletivo"

#: inc/dashboard.php:124
#, fuzzy
Expand All @@ -1511,11 +1511,14 @@ msgstr "Está com problemas, precisa de suporte?"
#: inc/dashboard.php:125
#, fuzzy, php-format
msgid ""
"Support for %s WordPress theme is conducted through FameThemes support "
"ticket system."
"Support for %s is conducted through the WordPress oficial repository support."
msgstr ""
"Suporte para o %s será feito diretamente nos repositório oficial do "
"WordPress."
"Suporte para o %s será feito diretamente no repositório oficial do WordPress."

#: inc/dashboard.php:126
#, fuzzy
msgid "Ask for support"
msgstr "Peça por Suporte"

#: inc/dashboard.php:145 inc/dashboard.php:158
#, fuzzy
Expand Down
Binary file modified languages/pt_BR.mo
Binary file not shown.
Loading

0 comments on commit c3677e9

Please sign in to comment.