diff options
Diffstat (limited to 'plugins/wordpress-mobile-pack/admin/pages')
3 files changed, 186 insertions, 5 deletions
diff --git a/plugins/wordpress-mobile-pack/admin/pages/category-details.php b/plugins/wordpress-mobile-pack/admin/pages/category-details.php new file mode 100755 index 00000000..4a740ff7 --- /dev/null +++ b/plugins/wordpress-mobile-pack/admin/pages/category-details.php @@ -0,0 +1,150 @@ +<script type="text/javascript"> + if (window.WMPJSInterface && window.WMPJSInterface != null){ + jQuery(document).ready(function(){ + + WMPJSInterface.localpath = "<?php echo plugins_url()."/".WMP_DOMAIN."/"; ?>"; + WMPJSInterface.init(); + }); + } +</script> +<?php +// Load Free or Premium menu +$menu_type = 'free'; + +if (WMobilePack_Options::get_setting('premium_active') == 1 && WMobilePack_Options::get_setting('premium_api_key') != '') { + + $menu_type = 'premium_classic'; + + $kit_type = WMobilePack::get_kit_type(); + if ($kit_type == 'wpmp'){ + $menu_type = 'premium_wpmp'; + } +} +?> +<div id="wmpack-admin"> + <div class="spacer-60"></div> + <!-- set title --> + <h1><?php echo WMP_PLUGIN_NAME.' '.WMP_VERSION;?><?php echo $menu_type != 'free' ? ' - Premium' : '';?></h1> + <div class="spacer-20"></div> + <div class="content"> + <div class="left-side"> + + <!-- add nav menu --> + <?php + if ($menu_type == 'free') + include_once(WMP_PLUGIN_PATH.'admin/sections/admin-menu.php'); + elseif ($menu_type == 'premium_wpmp') + include_once(WMP_PLUGIN_PATH.'admin/sections/admin-menu-premium.php'); + ?> + <div class="spacer-0"></div> + + <div class="details branding-category"> + <h2 class="title">Add image for category "<?php echo $category->name;?>"</h2> + <div class="spacer-15"></div> + <div class="grey-line"></div> + <div class="spacer-15"></div> + <p> + The image will be displayed in the mobile web app (categories menu).<br/> + <strong>Editing the content from the below section will not change your desktop category settings.</strong> + </p> + <div class="spacer-15"></div> + <div class="left"> + <form name="wmp_categoryedit_form" id="wmp_categoryedit_form" action="<?php echo admin_url('admin-ajax.php'); ?>?action=wmp_theme_editimages&type=upload" method="post" enctype="multipart/form-data"> + + <?php + $icon_path = ''; + $categories_details = WMobilePack_Options::get_setting('categories_details'); + + if (is_array($categories_details)) { + + if (array_key_exists($category->cat_ID, $categories_details)) { + + if (is_array($categories_details[$category->cat_ID])) { + + if (array_key_exists('icon', $categories_details[$category->cat_ID])) { + + $icon_path = $categories_details[$category->cat_ID]['icon']; + + if ($icon_path != ''){ + if (!file_exists(WMP_FILES_UPLOADS_DIR . $icon_path)) + $icon_path = ''; + else + $icon_path = WMP_FILES_UPLOADS_URL . $icon_path; + } + } + } + } + } + ?> + <input type="hidden" name="wmp_categoryedit_id" id="wmp_categoryedit_id" value="<?php echo $category->cat_ID;?>" /> + + <!-- upload icon field --> + <div class="wmp_categoryedit_uploadicon" style="display: <?php echo $icon_path == '' ? 'block' : 'none';?>;"> + + <label for="wmp_categoryedit_icon">Upload your category image</label> + + <div class="custom-upload"> + + <input type="file" id="wmp_categoryedit_icon" name="wmp_categoryedit_icon" /> + <div class="fake-file"> + <input type="text" id="fakefileicon" disabled="disabled" /> + <a href="#" class="btn grey smaller">Browse</a> + </div> + + <a href="javascript:void(0)" id="wmp_categoryedit_icon_removenew" class="remove" style="display: none;"></a> + </div> + <!-- cancel upload icon button --> + <div class="wmp_categoryedit_changeicon_cancel cancel-link" style="display: none;"> + <a href="javascript:void(0);" class="cancel">cancel</a> + </div> + <div class="field-message error" id="error_icon_container"></div> + + </div> + + <!-- icon image --> + <div class="wmp_categoryedit_iconcontainer display-icon" style="display: <?php echo $icon_path != '' ? 'block' : 'none';?>;;"> + + <label for="branding_icon">Category image</label> + <img src="<?php echo $icon_path;?>" id="wmp_categoryedit_currenticon" /> + + <!-- edit/delete icon links --> + <a href="javascript:void(0);" class="wmp_categoryedit_changeicon btn grey smaller edit">Change</a> + <a href="#" class="wmp_categoryedit_deleteicon smaller remove">remove</a> + </div> + + <div class="spacer-20"></div> + <div class="inline-btns-container"> + <a href="javascript:void(0);" id="wmp_categoryedit_send_btn" class="btn blue smaller spaced-right" style="cursor: pointer; opacity: 1;">Save</a> + <a href="<?php echo add_query_arg(array('page'=>'wmp-options-content'), network_admin_url('admin.php'));?>" class="btn grey smaller" style="cursor: pointer; opacity: 1; text-transform:none;">Back</a> + </div> + </form> + </div> + + + <div class="spacer-0"></div> + </div> + <div class="spacer-15"></div> + </div> + + + <div class="right-side"> + <!-- waitlist form --> + <?php + if ($menu_type == 'free') + include_once(WMP_PLUGIN_PATH.'admin/sections/waitlist.php'); + ?> + + <!-- add feedback form --> + <?php include_once(WMP_PLUGIN_PATH.'admin/sections/feedback.php'); ?> + </div> + </div> +</div> + +<script type="text/javascript"> + if (window.WMPJSInterface && window.WMPJSInterface != null){ + jQuery(document).ready(function(){ + window.WMPJSInterface.add("UI_categorydetails","WMP_CATEGORY_DETAILS",{'DOMDoc':window.document}, window); + }); + } +</script> + diff --git a/plugins/wordpress-mobile-pack/admin/pages/content.php b/plugins/wordpress-mobile-pack/admin/pages/content.php index 7524000d..1f5b813f 100755 --- a/plugins/wordpress-mobile-pack/admin/pages/content.php +++ b/plugins/wordpress-mobile-pack/admin/pages/content.php @@ -154,17 +154,48 @@ } else
$arrOrderedCategories = $categories;
-
+
+ $categories_details = WMobilePack_Options::get_setting('categories_details');
+
foreach ($arrOrderedCategories as $key => $category):
$status = 'active';
if (in_array($category->cat_ID, $inactive_categories))
$status = 'inactive';
+
+ // check category icon path
+ $icon_path = '';
+ if (is_array($categories_details)) {
+
+ if (array_key_exists($category->cat_ID, $categories_details)) {
+
+ if (is_array($categories_details[$category->cat_ID])) {
+
+ if (array_key_exists('icon', $categories_details[$category->cat_ID])) {
+
+ $icon_path = $categories_details[$category->cat_ID]['icon'];
+
+ if ($icon_path != ''){
+ if (!file_exists(WMP_FILES_UPLOADS_DIR . $icon_path))
+ $icon_path = '';
+ else
+ $icon_path = WMP_FILES_UPLOADS_URL . $icon_path;
+ }
+ }
+ }
+ }
+ }
?>
<li data-category-id="<?php echo $category->cat_ID;?>" data-order="<?php echo $key;?>">
- <span class="status <?php echo $status;?>"><?php echo $status;?></span>
- <span class="title"><?php echo $category->name;?></span>
- <span class="posts"><?php echo $category->category_count != 1 ? $category->category_count.' posts' : '1 post';?> published</span>
+ <div class="row">
+ <span class="status <?php echo $status;?>"><?php echo $status;?></span>
+ <span class="pic <?php echo $icon_path == '' ? 'default' : ''?>" <?php if ($icon_path != ''):?>style="background-image: url(<?php echo $icon_path;?>);"<?php endif;?>></span>
+ <span class="title"><?php echo $category->name;?></span>
+ <span class="posts"><?php echo $category->category_count != 1 ? $category->category_count.' posts' : '1 post';?> published</span>
+ </div>
+ <div class="buttons">
+ <a href="<?php echo admin_url('admin.php?page=wmp-category-details&id='.$category->cat_ID);?>" class="edit" title="Edit category for mobile"></a>
+ </div>
</li>
<?php endforeach;?>
</ul>
diff --git a/plugins/wordpress-mobile-pack/admin/pages/settings.php b/plugins/wordpress-mobile-pack/admin/pages/settings.php index 63215eeb..0e8a48ae 100755 --- a/plugins/wordpress-mobile-pack/admin/pages/settings.php +++ b/plugins/wordpress-mobile-pack/admin/pages/settings.php @@ -170,7 +170,7 @@ <div class="display-mode">
<h2 class="title">Language Settings</h2>
<div class="spacer-20"></div>
- <p>Wordpress Mobile Pack will automatically translate your mobile web app in one of the supported languages: Dutch, English, French, German, Hungarian, Italian, Polish, Portuguese (Brazil), Romanian, Spanish or Swedish. This is done based on your Wordpress settings and doesn't require additional changes from the plugin. A big thanks to all of our <a href="https://wordpress.org/plugins/wordpress-mobile-pack/other_notes/" target="_blank">contributors</a>.</p>
+ <p>Wordpress Mobile Pack will automatically translate your mobile web app in one of the supported languages: Chinese (zh_CN), Dutch, English, French, German, Hungarian, Italian, Polish, Portuguese (Brazil), Romanian, Spanish or Swedish. This is done based on your Wordpress settings and doesn't require additional changes from the plugin. A big thanks to all of our <a href="https://wordpress.org/plugins/wordpress-mobile-pack/other_notes/" target="_blank">contributors</a>.</p>
<div class="spacer-10"></div>
<p>However, if you wish to add another language or change the labels for your current one, you can do so by editing the language files located in <strong><?php echo WMP_PLUGIN_PATH."frontend/locales";?></strong>. To ensure your translation file will not be overwritten by future updates, please send it to our <a href="mailto:<?php echo WMP_FEEDBACK_EMAIL;?>">support team</a>.</p>
<div class="spacer-10"></div>
|