This is very simple module to switch your site to mobile version when detect what you (or your users) see site on mobile devices (like iPhone, iPad, HTC, BlackBerry, Nokia, etc).

Mobile site switcher catches the value of User-Agent in a browser, and compares it. If it turns out that the User-agent belongs to a mobile device, it does a quick redirect to a special URL (specified in the module settings).

Features

  • Support detect mobile devices on OS: Apple iOS, Android, BlackBerry, Symbian, Windows Phone (7, 8) and webOS;
  • Also detect all mobile browsers like Opera Mini and Fennec (Mozilla Firefox mobile);
  • Change your mobile site on admin page and save them to DB;
  • You may use <?php echo _mobile_site_switcher_get_urls(); ?> to display URL of your mobile site. Useful for theme creators;
  • Module supports two languages from box: russian and english.

Project page: http://drupal.org/sandbox/VikkyShostak/1483674
External project page: http://www.vikkyshostak.ru/mobile-site-switcher

git: http://drupalcode.org/sandbox/VikkyShostak/1483674.git

Support only Drupal 7.x version.

// Do not use the attached module as it is possibly outdated!!

Comments

patrickd’s picture

Issue summary: View changes

Warn of attachement

patrickd’s picture

Assigned: koddr » Unassigned
Status: Needs review » Needs work

welcome,

we need the drupal.org project page not your external one, I added it for you ;)
Also, please maintain your code on the project page on drupal.org and not on external sites, I know that's common practice on many other CMS's, but we'd like to have it all in one place on drupal.

Your git repository is empty, you have to push your code into a version specific branch.
Here are some instructions about using GIT on drupal.org
For working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.

regards

koddr’s picture

Priority: Major » Critical
Status: Needs work » Needs review

Hi! I added git to my project. It was not easy, because I git-newbie ;) what's next?

P.S. I'm sorry, that just stuck with the archive module - thought it would be better..

patrickd’s picture

Now you made the initial steps with git and pushed an .info file up.
You need to create a release branch now (like eg, 7.x-1.x), add all your code to it, commit and push it.
Maybe you should have a deeper look on git before you continue here, the version control system is one of the most important developer tools you'll need, definitely worth having a deeper look!

koddr’s picture

Good! Videos here http://vimeo.com/20459209 helped me!

Look at my git - all of it true?

patrickd’s picture

Status: Needs review » Needs work

Some points left:

  • The master branch should only contain a readme pointing to the release branches (See step 5 in http://drupal.org/node/1127732)
  • You got a wront-named branch 7.x-0.1, you should delete it (See here)
  • Delete the translations, this is handled by http://localize.drupal.org/
  • Remove the zip-files
  • If you're the only module using the package "Mobile site tools" it makes no sense to put your module in there -> delete the package information
  • Remove version = 7.x-1.0 this will be added by the release packaging system later
  • Remove all ; $Id$ these are outdated since drupal.org uses git
koddr’s picture

Priority: Critical » Major
Status: Needs work » Needs review

All done! On all counts.
Forgive me for so long that I was thinking ;)

chhavik’s picture

Status: Needs review » Needs work

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
The following git branches do not match the release branch pattern, you should remove/rename them. See http://drupal.org/node/1015226

remotes/origin/7.x-0.1

Review of the 7.x-1.x branch:

Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards). See http://ventral.org/pareview/httpgitdrupalorgsandboxvikkyshostak1483674git

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

Manual Review :-

  • mobile_site_switcher.module: line#29 Form elements name should be better, instead of 'urls'.
  • Declare the form array first in function mobile_site_switcher_settings()
  • line #72: use function l() as it contains link.
  • Points mentioned by patrickd, haven't been resolved yet.
patrickd’s picture

Priority: Major » Normal
koddr’s picture

StatusFileSize
new781.39 KB

Big thx to chhavik! Study, study, study...

Can I remove this? How to start my git (or sandbox project) with clear list?

card 1

patrickd’s picture

Here's a tutorial about how to remove remote branches: http://gitready.com/beginner/2009/02/02/push-and-delete-branches.html

koddr’s picture

Ok. Let's do it again!
I was able to fix all that. Take a look please.

Another question: how to remove the current shortlog and why they don't appear commits of the 7.x-1.x ??

chertzog’s picture

Here are some things:

There are numerous code style issues. (http://ventral.org/pareview/httpgitdrupalorgsandboxvikkyshostak1483674git)

Lines 39-42:It's always good to put (submit) buttons in an "actions" form element.

  $form['submit'] = array(
                 '#type' => 'submit',  
                 '#value' => t('Save settings'),  
         );

Should be:

  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t("Save settings"),
  );

Line 78: See this comment.

drupal_set_message(t('Don\'t forget to ').l('clear your cache!', 'admin/config/development/performance'));

Should be:

drupal_set_message(t("Don't forget to !url", array('!url' =>l('clear your cache!','admin/config/development/performance'))));

On lines 116 - 119:

         $mobile_url_post = _mobile_site_switcher_get_urls(); 
  
         // Main module function 2 
         if (!empty($mobile_url)) {

Line 199: I don't see $mobile_url defined anywhere, so im guessing you meant it to be $mobile_url_post.

koddr’s picture

Status: Needs work » Needs review

Thanks a lot, chertzog!

What about remotes/origin/7.x-0.1 warning?! I deleted everything except the right branch 7.x-1.x, and they are not in my list git branch. Why is the site gives it all the same?

And where and what needs to be fixed at such a message:

Review of the 7.x-1.x branch:

The "?>" PHP delimiter at the end of files is discouraged, see http://drupal.org/node/318#phptags

./mobile_site_switcher.module
./mobile_site_switcher.install
chertzog’s picture

Nothing, the review just needed to be rerun. I have re-run the automated check, and the remotes/origin/7.x-0.1 warning has been removed.

Go check the review again (http://ventral.org/pareview/httpgitdrupalorgsandboxvikkyshostak1483674git)

As for the other warning, its just telling you to delete the closing php tag "?>" form both the .install, and .module files.

koddr’s picture

Status: Needs review » Fixed

Ok. I corrected all bad things what I seen. Thanks to chertzog!
I think it's fixed status.

So, what next?

chertzog’s picture

Status: Fixed » Needs review

Nope. Just leave it as needs review for one of the actual reviewers to go over, and make a decision.

patrickd’s picture

BTW
there are no "actual reviewers"
Anybody can be a reviewer and any applicant could do it also!

workflow is
"needs review" by any reviewer -> if a reviewer thinks it's good -> "RTBC" -> Git Admin reviews it -> if okay for him -> "fixed"

koddr’s picture

Hello again!

Interesting workflow! But what is "RTBC" in step no. 3?

patrickd, in your profile says that you are an "administrator on the git of d.o". So you can also check out my module and add him to the status of "fixed", right?

patrickd’s picture

RTBC = reviewed & tested by the community

Yes, right, but keep in mind that there are 160 other applications, so that will take some time.

Please consider helping out with manual reviews of other applications and get a review bonus, that will give your module higher priority.

koddr’s picture

So... what about review my module?

chhavik’s picture

Status: Needs review » Needs work
StatusFileSize
new18.83 KB

Hi,

I found coding issues with your module. See attachment. Review of the 7.x-1.x branch:

Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards). See http://ventral.org/pareview/httpgitdrupalorgsandboxchhavik1379612git.
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.

Manual review :-

1) Hook definitions are not proper. For eg:- Implements hook_menu(). Refer more http://drupal.org/node/1354#hookimpl

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

klausi’s picture

Issue summary: View changes

Added drupal.org project page