This module add MobileMenu jQuery plugin as a library, it's a thin and very customizable plugin which allow to build on-canvas sliding mobile menus, it is usable for theme developers. Basically the module just add that plugin as a library which can be imported via code below.

drupal_add_library('jquery_mobilemenu', 'jquery.mobilemenu');

But it also provide an administration page in where you can easily choose the themes where library must be loaded. There are hook_init function which check is current theme one of the selected in admin page, if yes it's import the library

For more demo check this link.

Project Page: jQuery MobileMenu
Clone Command: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/sargismarkosyan/2316879.git jquery_mobilemenu

Comments

sargismarkosyan’s picture

Issue summary: View changes
sargismarkosyan’s picture

Issue summary: View changes
anil280988’s picture

Status: Needs review » Needs work

The git command provided by you is the private git command that you will use. Kindly provide the public git command so that others can clone your module. It will be like this.

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/username/module_path module_name

sargismarkosyan’s picture

Issue summary: View changes
sargismarkosyan’s picture

Status: Needs work » Needs review
sargismarkosyan’s picture

Thanks for comment I fix that.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

th_tushar’s picture

Status: Needs review » Needs work

Hi @sargismarkosyan,

I have manually reviewed your code, and found some issues,

1) In hook_theme(), its better to use "administer jquery mobilemenu" instead of "administer jquery.mobilemenu".

2) I have seen that you are setting your module specific variables in jquery_mobilemenu_admin_submit(), so you will have to write the hook_uninstall() function in .install file to delete these variables on un-installation of the module.

3) The function jquery_mobilemenu_admin($form) should also contain a reference to $form_state as a second parameter.

4) Why is the #type => 'actions' required in jquery_mobilemenu_admin() function?

<?php
$form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save changes'));
?>

As you have only one action, you can directly use,

<?php
$form['submit_name'] = array('#type' => 'submit', '#value' => t('Save changes'));
?>

*5) There is no proper instruction to the module installer/user to download the required library files and copy to sites/all/libraries. Are you checking if the library files are copied to site by user while installation of the module and displaying the error if library files are not found?

Changing the status to "Needs Work".

Please fix the above issues, and you can change the status back to "Needs Review".

Thanks

sargismarkosyan’s picture

Hi @th_tushar,

Thanks for review, I fixed these issues.

sargismarkosyan’s picture

Status: Needs work » Needs review
raffi’s picture

Status: Needs review » Reviewed & tested by the community
kscheirer’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)
Issue tags: +PAreview: single application approval

Blocking Issues:

  1. Code too simple - this module is a wrapper for including a jquery library, it does not provide much else. While this means we cannot grant "git vetted user" status based on this work along, we are still able to promote this project by itself. Please indicate if that is an acceptable solution or if you disagree with this opinion.

Non-blocking issues:

  • Using hook_init() will get called on every Drupal request, you probably want hook_page_build() instead
  • In jquery_mobilemenu_admin() you can use system_settings_form() and then don't need to define your own submit function
  • You can also move jquery_mobilemenu_admin() to its own file, this will improve performance slightly
wuxiaogu’s picture

In hook_library()

  $library = libraries_get_path('jquery.mobilemenu');
  $libraries['jquery.mobilemenu'] = array(
    'title' => 'jQuery MobileMenu',
    'website' => 'http://sargismarkosyan.github.io/MobileMenu/',
    'version' => array(),
    'js' => array(
      $library . '/jquery.mobilemenu.js' => array(
        'scope' => 'footer',
      ),
    ),
    'css' => array(
      $library . '/jquery.mobilemenu.css' => array(
        'type' => 'file',
        'media' => 'screen',
      ),
    ),
  );

I think you'd better write like this:

  $libraries = array();
  $libs = libraries_get_libraries();
  if (array_key_exists('jquery.mobilemenu', $libs)) {
    $libraries['jquery.mobilemenu'] = array(
      'title' => 'jQuery MobileMenu',
      'website' => 'http://sargismarkosyan.github.io/MobileMenu/',
      'version' => array(),
      'js' => array(
        $library . '/jquery.mobilemenu.js' => array(
          'scope' => 'footer',
        ),
      ),
      'css' => array(
        $library . '/jquery.mobilemenu.css' => array(
          'type' => 'file',
          'media' => 'screen',
        ),
      ),
    );

  }
  return $libraries;

I add a if judgement, i think it is better.

PA robot’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.