There are many coding standard violations which makes reviewing the code very hard.

http://pareview.sh/pareview/httpgitdrupalorgprojectdrupalchatgit refuses to run because there is a git tag that has the same name as the branch 7.x-1.x. Make sure to remove this tag to avoid confusion.

Coder Sniffer can be used to detect the coding standard errors.

CommentFileSizeAuthor
#2 2339391-1.patch61.4 KBgurbakshish

Issue fork drupalchat-2339391

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rohit.rawat619’s picture

Assigned: Unassigned » rohit.rawat619
gurbakshish’s picture

FileSize
61.4 KB
apaderno’s picture

Status: Active » Needs work
+function drupalchat_app_settings()
+{
+    global $user;
+
+    if (isset($_SESSION['token']) && !empty($_SESSION['token'])) {
+        $token = $_SESSION['token'];
+    } else {
+        $json = _drupalchat_get_auth(array());
+        $token = $json['key'];
+    }
+
+    $drupalchat_host = DRUPALCHAT_EXTERNAL_A_HOST;
+    $host = explode("/", $drupalchat_host);
+    $host_name = $host[2];
+
+    $dashboardUrl = "https://". DRUPALCHAT_EXTERNAL_CDN_HOST ."/apps/dashboard/#/settings/app?sessid=". $token ."&hostName=". $host_name ."&hostPort=". DRUPALCHAT_EXTERNAL_A_PORT;
+    $form = array();
+    $form['drupalchat_app_dashboard'] = array(
+      '#type' => 'button',
+      '#attributes' => array('onClick' => 'window.open("'.$dashboardUrl.'","_blank")'),
+      '#value' => t('Click here to open App Dashboard'),
+    );
+
+    return $form;
+}

Code must be formatted following the Drupal coding standards, for which the indentation is two spaces and the opening curly parenthesis must be in the same line containing the function declaration, among other things.

rohit.rawat619’s picture

Assigned: rohit.rawat619 » Unassigned
Status: Needs work » Closed (won't fix)
apaderno’s picture

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

shivam_tiwari made their first commit to this issue’s fork.

shivam_tiwari’s picture