cloudiq - Version 2.0.0

Version Notes

Move the Cloudiq_Core framework into a separate package.

Download this release

Release Info

Developer cloud.IQ
Extension cloudiq
Version 2.0.0
Comparing to
See all releases


Code changes from version 1.0.4 to 2.0.0

Files changed (31) hide show
  1. app/code/community/Cloudiq/Callme/Block/Adminhtml/Config/Edit/Tab/Callme.php +2 -2
  2. app/code/community/Cloudiq/Callme/Test/Controller/Block.php +3 -3
  3. app/code/community/Cloudiq/Core/.gitkeep +0 -0
  4. app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit.php +0 -15
  5. app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit/Form.php +0 -12
  6. app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit/Tab/Frame.php +0 -43
  7. app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit/Tab/Global.php +0 -87
  8. app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit/Tabs.php +0 -20
  9. app/code/community/Cloudiq/Core/Helper/Config.php +0 -58
  10. app/code/community/Cloudiq/Core/Helper/Data.php +0 -5
  11. app/code/community/Cloudiq/Core/Model/Api/Abstract.php +0 -10
  12. app/code/community/Cloudiq/Core/Model/Api/Core.php +0 -67
  13. app/code/community/Cloudiq/Core/Model/Api/Request.php +0 -109
  14. app/code/community/Cloudiq/Core/Model/Api/Response.php +0 -170
  15. app/code/community/Cloudiq/Core/Test/Config/Base.php +0 -26
  16. app/code/community/Cloudiq/Core/Test/Model/Api/Response.php +0 -55
  17. app/code/community/Cloudiq/Core/Test/Model/Api/TestCase.php +0 -47
  18. app/code/community/Cloudiq/Core/Test/Model/Api/data/Response/testWasSuccessfulBadResponseAttribute.txt +0 -15
  19. app/code/community/Cloudiq/Core/Test/Model/Api/data/Response/testWasSuccessfulStatusCodeAndResponseAttribute.txt +0 -16
  20. app/code/community/Cloudiq/Core/controllers/Adminhtml/CloudiqController.php +0 -93
  21. app/code/community/Cloudiq/Core/etc/adminhtml.xml +0 -31
  22. app/code/community/Cloudiq/Core/etc/config.xml +0 -70
  23. app/design/adminhtml/default/default/layout/cloudiq/core.xml +0 -50
  24. app/design/adminhtml/default/default/template/cloudiq/core/tab/frame/iframe.phtml +0 -11
  25. app/design/adminhtml/default/default/template/cloudiq/core/tab/frame/submitter.phtml +0 -11
  26. app/design/adminhtml/default/default/template/cloudiq/core/tabs.phtml +0 -39
  27. app/design/adminhtml/default/default/template/cloudiq/global/tab.phtml +0 -1
  28. app/design/adminhtml/default/default/template/cloudiq/global/widget/form.phtml +0 -15
  29. app/etc/modules/Cloudiq_Core.xml +0 -9
  30. package.xml +6 -6
  31. skin/adminhtml/default/default/cloudiq/core.css +0 -41
app/code/community/Cloudiq/Callme/Block/Adminhtml/Config/Edit/Tab/Callme.php CHANGED
@@ -35,6 +35,8 @@ class Cloudiq_Callme_Block_Adminhtml_Config_Edit_Tab_Callme extends Mage_Adminht
35
  $this->_addPopupFieldset($form);
36
  $this->_addCallbackFieldset($form);
37
  $this->_addPublishedFieldset($form);
 
 
38
  }
39
 
40
  protected function _addPublishedFieldset($form) {
@@ -232,8 +234,6 @@ class Cloudiq_Callme_Block_Adminhtml_Config_Edit_Tab_Callme extends Mage_Adminht
232
  'value' => ($this->_input_data) ? $this->_input_data->getData("popup/confirmation_closed") : $this->_config_model->getPopUpConfClosed(),
233
  'required' => true,
234
  ));
235
-
236
- $this->setForm($form);
237
  }
238
 
239
  protected function _addButtonFieldset($form) {
35
  $this->_addPopupFieldset($form);
36
  $this->_addCallbackFieldset($form);
37
  $this->_addPublishedFieldset($form);
38
+
39
+ $this->setForm($form);
40
  }
41
 
42
  protected function _addPublishedFieldset($form) {
234
  'value' => ($this->_input_data) ? $this->_input_data->getData("popup/confirmation_closed") : $this->_config_model->getPopUpConfClosed(),
235
  'required' => true,
236
  ));
 
 
237
  }
238
 
239
  protected function _addButtonFieldset($form) {
app/code/community/Cloudiq/Callme/Test/Controller/Block.php CHANGED
@@ -12,7 +12,7 @@ class Cloudiq_Callme_Test_Controller_Block extends EcomDev_PHPUnit_Test_Case_Con
12
  $this->dispatch($path);
13
  $this->assertModuleConfigured();
14
  $this->assertLayoutHandleLoaded($handle);
15
- $this->assertLayoutBlockRendered('cloudiq_callme.button_js');
16
  }
17
 
18
  /**
@@ -24,7 +24,7 @@ class Cloudiq_Callme_Test_Controller_Block extends EcomDev_PHPUnit_Test_Case_Con
24
  $this->dispatch('');
25
  $this->assertModuleConfigured();
26
  $this->assertLayoutHandleLoaded('cms_index_index');
27
- $this->assertLayoutBlockNotRendered('cloudiq_callme.button_js');
28
  }
29
 
30
  /**
@@ -36,7 +36,7 @@ class Cloudiq_Callme_Test_Controller_Block extends EcomDev_PHPUnit_Test_Case_Con
36
  $this->dispatch('');
37
  $this->assertModuleConfigured();
38
  $this->assertLayoutHandleLoaded('cms_index_index');
39
- $this->assertLayoutBlockNotRendered('cloudiq_callme.button_js');
40
  }
41
 
42
  public function assertModuleConfigured() {
12
  $this->dispatch($path);
13
  $this->assertModuleConfigured();
14
  $this->assertLayoutHandleLoaded($handle);
15
+ $this->assertLayoutBlockRendered('cloudiq_callme.button');
16
  }
17
 
18
  /**
24
  $this->dispatch('');
25
  $this->assertModuleConfigured();
26
  $this->assertLayoutHandleLoaded('cms_index_index');
27
+ $this->assertLayoutBlockNotRendered('cloudiq_callme.button');
28
  }
29
 
30
  /**
36
  $this->dispatch('');
37
  $this->assertModuleConfigured();
38
  $this->assertLayoutHandleLoaded('cms_index_index');
39
+ $this->assertLayoutBlockNotRendered('cloudiq_callme.button');
40
  }
41
 
42
  public function assertModuleConfigured() {
app/code/community/Cloudiq/Core/.gitkeep DELETED
File without changes
app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- class Cloudiq_Core_Block_Adminhtml_Config_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
3
- public function __construct() {
4
- parent::__construct();
5
-
6
- $this->_blockGroup = 'cloudiq_core';
7
- $this->_controller = 'adminhtml_config';
8
- $this->_mode = 'edit';
9
-
10
- }
11
-
12
- public function getHeaderText() {
13
- return $this->__('cloud.IQ Settings');
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit/Form.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Cloudiq_Core_Block_Adminhtml_Config_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
3
-
4
- public function _prepareForm() {
5
- $url = Mage::helper('adminhtml')->getUrl('*/*/save');
6
- $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $url, 'method' => 'post'));
7
- $form->setUseContainer(true);
8
- $this->setForm($form);
9
- return parent::_prepareForm();
10
- }
11
-
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit/Tab/Frame.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- class Cloudiq_Core_Block_Adminhtml_Config_Edit_Tab_Frame extends Mage_Adminhtml_Block_Abstract implements Mage_Adminhtml_Block_Widget_Tab_Interface {
3
-
4
- /** @var $_helper Cloudiq_Core_Helper_Config */
5
- protected $_helper;
6
-
7
- public function _construct() {
8
- $this->_helper = Mage::helper("cloudiq_core/config");
9
-
10
- $this->setTemplate("cloudiq/core/tab/frame/iframe.phtml");
11
- }
12
-
13
- /**
14
- * Return the URL to query for the iframe's content.
15
- *
16
- * @return string
17
- */
18
- public function getSubmitterUrl() {
19
- return $this->getUrl("adminhtml/cloudiq/frame", array(
20
- "module" => $this->getModule()
21
- ));
22
- }
23
-
24
- public function getTabLabel() {
25
- return $this->__($this->getLabel());
26
- }
27
-
28
- public function getTabTitle() {
29
- return $this->__($this->getLabel());
30
- }
31
-
32
- public function canShowTab() {
33
- return $this->_helper->hasBeenSetUp();
34
- }
35
-
36
- public function isHidden() {
37
- return !$this->_helper->hasBeenSetUp();
38
- }
39
-
40
- protected function getFrameId() {
41
- return "cloudiq_frame_" . $this->getModule();
42
- }
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit/Tab/Global.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- class Cloudiq_Core_Block_Adminhtml_Config_Edit_Tab_Global extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface {
3
- /** @var $_helper Cloudiq_Core_Helper_Data */
4
- protected $_helper;
5
- /** @var $_config_helper Cloudiq_Core_Helper_Config */
6
- protected $_config_helper;
7
-
8
- public function __construct() {
9
- parent::__construct();
10
-
11
- $this->_helper = Mage::helper('cloudiq_core');
12
- $this->_config_helper = Mage::helper('cloudiq_core/config');
13
-
14
- $this->setTemplate('cloudiq/global/widget/form.phtml');
15
- }
16
-
17
- protected function _prepareForm() {
18
- $form = new Varien_Data_Form();
19
- $fieldset = $form->addFieldset('settings', array('legend'=>$this->_helper->__('Global Settings')));
20
-
21
- $fieldset->addField('global[enabled]', 'select', array(
22
- 'label' => $this->_helper->__('Enable Account?'),
23
- 'title' => $this->_helper->__('Enable Account?'),
24
- 'name' => 'global[enabled]',
25
- 'value' => $this->_config_helper->isEnabled(),
26
- 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray()
27
- ));
28
-
29
- $fieldset->addField('global[account_id]', 'text', array(
30
- 'label' => $this->_helper->__('cloud.IQ Account ID'),
31
- 'title' => $this->_helper->__('cloud.IQ Account ID'),
32
- 'name' => 'global[account_id]',
33
- 'note' => "Cut and paste this from the cloud.IQ confirmation message.",
34
- 'value' => $this->_config_helper->getAccountId(),
35
- 'required' => true
36
- ));
37
-
38
- $fieldset->addField('global[token]', 'text', array(
39
- 'label' => $this->_helper->__('cloud.IQ Token'),
40
- 'title' => $this->_helper->__('cloud.IQ Token'),
41
- 'name' => 'global[token]',
42
- 'note' => "Cut and paste this from the cloud.IQ confirmation message.",
43
- 'value' => $this->_config_helper->getToken(),
44
- 'required' => true
45
- ));
46
-
47
- $this->setForm($form);
48
- }
49
-
50
- public function getTabLabel() {
51
- $label = $this->hasBeenSetUp() ? "Global Settings" : "cloud.IQ Sign up";
52
- return $this->__($label);
53
- }
54
-
55
- public function getTabTitle() {
56
- $label = $this->hasBeenSetUp() ? "Global Settings" : "cloud.IQ Sign up";
57
- return $this->__($label);
58
- }
59
-
60
- public function canShowTab() {
61
- // Always show the Global settings tab
62
- return true;
63
- }
64
-
65
- public function isHidden() {
66
- // Always show the Global settings tab
67
- return false;
68
- }
69
-
70
- /**
71
- * Check if the module has been setup with API access credentials.
72
- *
73
- * @return bool
74
- */
75
- protected function hasBeenSetUp() {
76
- return $this->_config_helper->hasBeenSetUp();
77
- }
78
-
79
- /**
80
- * Return the URL used for the Setup iFrame.
81
- *
82
- * @return string
83
- */
84
- protected function getSetupUrl() {
85
- return $this->getUrl("adminhtml/cloudiq/frame", array("module" => "signUp", "profile_id" => 2));
86
- }
87
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Block/Adminhtml/Config/Edit/Tabs.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- class Cloudiq_Core_Block_Adminhtml_Config_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
3
-
4
- protected $_config_helper;
5
-
6
- public function __construct() {
7
- parent::__construct();
8
- $this->setId('cloudiq_config_edit_tabs');
9
- $this->setDestElementId('edit_form');
10
- $this->setTitle(Mage::helper('adminhtml')->__('cloud.IQ Configuration'));
11
- $this->_config_helper = Mage::helper('cloudiq_core/config');
12
- $this->setTemplate('cloudiq/core/tabs.phtml');
13
- }
14
-
15
- protected function _beforeToHtml() {
16
- // Open the Global Settings form tab by default
17
- $this->setActiveTab("global_section");
18
- return parent::_beforeToHtml();
19
- }
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Helper/Config.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
- class Cloudiq_Core_Helper_Config extends Mage_Core_Helper_Abstract {
3
-
4
- const CLOUDIQ_BASE_URL = "https://platform.cloud-iq.com/";
5
-
6
- public function hasBeenSetUp() {
7
- return $this->getToken() != "";
8
- }
9
-
10
- public function getAccountId() {
11
- return Mage::getStoreConfig('cloudiq_core/global/account_id');
12
- }
13
-
14
- public function getToken() {
15
- return Mage::getStoreConfig('cloudiq_core/global/token');
16
- }
17
-
18
- public function isEnabled() {
19
- return Mage::getStoreConfig('cloudiq_core/global/enabled');
20
- }
21
-
22
- /**
23
- * Return a URL for the cloud.IQ service.
24
- *
25
- * @param $module
26
- *
27
- * @return string
28
- */
29
- public function getCloudiqUrl($module, $profile_id = false) {
30
- $url = self::CLOUDIQ_BASE_URL;
31
-
32
- $parameters = array();
33
-
34
- if ($module != "") {
35
- $parameters[] = "module=" . $module;
36
- }
37
-
38
- if ($profile_id) {
39
- $parameters[] = "profileId=" . $profile_id;
40
- }
41
-
42
- $parameters = implode("&", $parameters);
43
- if ($parameters != "") {
44
- $url .= "?" . $parameters;
45
- }
46
-
47
- return $url;
48
- }
49
-
50
- /**
51
- * Return the URL for cloud.IQ API calls.
52
- *
53
- * @return string
54
- */
55
- public function getCloudiqApiUrl() {
56
- return self::CLOUDIQ_BASE_URL . "gateway";
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Helper/Data.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
-
3
- class Cloudiq_Core_Helper_Data extends Mage_Core_Helper_Abstract {
4
-
5
- }
 
 
 
 
 
app/code/community/Cloudiq/Core/Model/Api/Abstract.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- class Cloudiq_Core_Model_Api_Abstract extends Varien_Object {
3
- /**
4
- * @return Cloudiq_Core_Model_Api_Request
5
- */
6
- protected function _getRequestObject() {
7
- return Mage::getModel('cloudiq_core/api_request');
8
- }
9
- }
10
-
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Model/Api/Core.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
-
3
- class Cloudiq_Core_Model_Api_Core extends Cloudiq_Core_Model_Api_Abstract {
4
-
5
- /**
6
- * Request account information from the cloud.IQ API for either the
7
- * account provided or the account stored in the configuration (if none
8
- * is provided). Returns an array with two elements:
9
- * status - boolean flag, true if the request was successful, false otherwise
10
- * content - the account information XML element, if the request was successful
11
- * or the error message if it failed
12
- *
13
- * @param $account_id Account ID to lookup instead of the configured one.
14
- * @param $token Account token to use instead of the configured one.
15
- *
16
- * @return array
17
- */
18
- public function lookupAccount($account_id = NULL, $token = NULL) {
19
- $parameters = array(
20
- "mode" => "lookup",
21
- "action" => "account"
22
- );
23
-
24
- if ($account_id != NULL && $token != NULL) {
25
- // Lookup the account provided instead of the one saved
26
- $parameters["id"] = $account_id;
27
- $parameters["token"] = $token;
28
- }
29
-
30
- /** @var Cloudiq_Core_Model_Api_Request $request */
31
- $request = $this->_getRequestObject()->setParameters($parameters);
32
- $response = $request->send(Zend_Http_Client::GET);
33
-
34
- $result = array(
35
- "status" => false,
36
- "content" => ""
37
- );
38
-
39
- if ($response) {
40
- if ($response->wasSuccessful()) {
41
- $account_response = $response->getResponse()->account;
42
-
43
- if (!is_null($account_response)) {
44
- if ($account_response["status"] == Cloudiq_Core_Model_Api_Response::STATUS_SUCCESS) {
45
- $result["status"] = true;
46
- $result["content"] = $account_response;
47
- } else {
48
- // Unsuccessful account response
49
- $result["content"] = $response->getApiStatusCodeDescription($account_id["status"]);
50
- if ($account_response->description) {
51
- $result["content"] .= sprintf(": %s", $account_response->description);
52
- }
53
- }
54
- } else {
55
- $result["content"] = "Unkown API response status";
56
- }
57
- } else {
58
- // Unsuccessful response
59
- $result["content"] = $response->getErrorMessage();
60
- }
61
- } else {
62
- $result["content"] = "Failed to connect to cloud.IQ API";
63
- }
64
-
65
- return $result;
66
- }
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Model/Api/Request.php DELETED
@@ -1,109 +0,0 @@
1
- <?php
2
- /**
3
- * @method setParameters(array $parameters)
4
- * @method getParameters()
5
- */
6
- class Cloudiq_Core_Model_Api_Request extends Varien_Object {
7
-
8
- const LOG_LOCATION = "cloudiq_api.log";
9
-
10
- /**
11
- * @param $method HTTP verb to use when making the request, e.g. GET, POST, DELETE, PUT.
12
- *
13
- * @throws Zend_Http_Exception
14
- *
15
- * @return Cloudiq_Core_Model_Api_Response
16
- */
17
- public function send($method) {
18
- $_config_helper = Mage::helper("cloudiq_core/config");
19
-
20
- $parameters = $this->getParameters();
21
- $get_params = array();
22
- $post_params = array();
23
-
24
- if (!isset($parameters["token"])) {
25
- // Authenticate through GET parameters
26
- $get_params["id"] = $_config_helper->getAccountId();
27
- $get_params["token"] = $_config_helper->getToken();
28
- }
29
-
30
- if ($method == Zend_Http_Client::GET) {
31
- $get_params = array_merge($get_params, $parameters);
32
- } else {
33
- $post_params = array_merge($post_params, $parameters);
34
- }
35
-
36
- $client = new Zend_Http_Client();
37
- $client
38
- ->setUri($this->getEndpoint())
39
- ->setParameterGet($get_params)
40
- ->setParameterPost($post_params)
41
- ->setMethod($method);
42
-
43
- try {
44
- /** @var $request_result Zend_Http_Response */
45
- $request_result = $client->request();
46
- } catch (Zend_Http_Client_Exception $e) {
47
- $this->_log(Zend_Log::ERR, $e->getMessage(), $this->getEndpoint(), $method, $get_params, $post_params);
48
- return null;
49
- }
50
-
51
- /** @var $response Cloudiq_Core_Model_Api_Response */
52
- $response = Mage::getModel('cloudiq_core/api_response');
53
- $response->populate($request_result);
54
-
55
- $this->_log(Zend_Log::DEBUG, "Success", $this->getEndpoint(), $method, $get_params, $post_params, $response);
56
-
57
- return $response;
58
- }
59
-
60
- /**
61
- * Return the URI to make API calls against.
62
- *
63
- * @return string
64
- */
65
- public function getEndpoint() {
66
- return Mage::helper("cloudiq_core/config")->getCloudiqApiUrl();
67
- }
68
-
69
- /**
70
- * Print the API request details to a log file.
71
- *
72
- * @param $level
73
- * @param $status
74
- * @param $url
75
- * @param $method
76
- * @param array $get_params
77
- * @param array $post_params
78
- * @param Cloudiq_Core_Model_Api_Response $response
79
- */
80
- protected function _log($level, $status, $url, $method, $get_params = array(), $post_params = array(), $response = NULL) {
81
- $message = sprintf("%s\nMethod: %s\nEndpoint: %s\n", $status, $method, $url);
82
-
83
- if (!empty($get_params)) {
84
- array_walk($get_params, function (&$v, $k) { $v = sprintf("%s = %s", $k, $v); });
85
- $message .= sprintf("GET Parameters:\n\t%s\n", implode("\n\t", $get_params));
86
- }
87
-
88
- if (!empty($post_params)) {
89
- array_walk($post_params, function (&$v, $k) { $v = sprintf("%s = %s", $k, $v); });
90
- $message .= sprintf("POST Parameters:\n\t%s\n", implode("\n\t", $post_params));
91
- }
92
-
93
- if (!is_null($response)) {
94
- $message .= sprintf("Response status: %s\n", ($response->wasSuccessful() ? "Successful" : "Failed"));
95
- if (!$response->wasSuccessful()) {
96
- $message .= sprintf("Response error: %s\n", $response->getErrorMessage());
97
- }
98
- $raw_response = $response->getRawResponse();
99
- if ($raw_response) {
100
- $message .= sprintf("Raw response:\n\t%s\n\t%s\n",
101
- $raw_response->getHeadersAsString(true, "\n\t"),
102
- implode("\n\t", explode("\n", $raw_response->getBody()))
103
- );
104
- }
105
- }
106
-
107
- Mage::log($message, $level, self::LOG_LOCATION);
108
- }
109
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Model/Api/Response.php DELETED
@@ -1,170 +0,0 @@
1
- <?php
2
- /**
3
- * @method setRawResponse(Zend_Http_Response $raw_response)
4
- * @method Zend_Http_Response getRawResponse()
5
- * @method setHttpStatusCode(int $status_code)
6
- * @method int getHttpStatusCode()
7
- * @method setXmlParseErrors(array $errors)
8
- * @method array getXmlParseErrors()
9
- * @method setResponse(SimpleXMLElement $data)
10
- * @method SimpleXMLElement getResponse()
11
- * @method bool hasResponse()
12
- */
13
- class Cloudiq_Core_Model_Api_Response extends Varien_Object {
14
-
15
- const STATUS_SUCCESS = 1;
16
- const STATUS_AUTHENTICATION_FAILURE = 101;
17
- const STATUS_REQUESTING_IP_NOT_VALID = 102;
18
- const STATUS_INVALID_FUNCTION_REQUEST = 103;
19
- const STATUS_REQUEST_MISSING_A_MANDATORY_PARAMETER = 104;
20
- const STATUS_FORMAT_ERROR_IN_REQUEST_PARAMETERS = 105;
21
- const STATUS_REQUEST_NOT_VALID_FOR_GIVEN_ACCOUNT = 106;
22
- const STATUS_INTERNAL_ERROR_WHILE_PROCESSING_YOUR_REQUEST = 107;
23
- const STATUS_VALIDATION_FAILED = 200;
24
-
25
- public static $status_code_descriptions = array(
26
- self::STATUS_SUCCESS => "Success",
27
- self::STATUS_AUTHENTICATION_FAILURE => "Authentication failure",
28
- self::STATUS_REQUESTING_IP_NOT_VALID => "Requesting ip not valid",
29
- self::STATUS_INVALID_FUNCTION_REQUEST => "Invalid function request",
30
- self::STATUS_REQUEST_MISSING_A_MANDATORY_PARAMETER => "Request missing a mandatory parameter",
31
- self::STATUS_FORMAT_ERROR_IN_REQUEST_PARAMETERS => "Format error in request parameters",
32
- self::STATUS_REQUEST_NOT_VALID_FOR_GIVEN_ACCOUNT => "Request not valid for given account",
33
- self::STATUS_INTERNAL_ERROR_WHILE_PROCESSING_YOUR_REQUEST => "Internal error while processing your request",
34
- self::STATUS_VALIDATION_FAILED => "Validation failed"
35
- );
36
-
37
- /**
38
- * Populate the response data from the given Zend_Http_Response object.
39
- *
40
- * @param Zend_Http_Response $raw_response
41
- *
42
- * @return $this
43
- */
44
- public function populate(Zend_Http_Response $raw_response) {
45
- $this->setRawResponse($raw_response);
46
-
47
- $this->setHttpStatusCode((int) $raw_response->getStatus());
48
-
49
- // Handle libxml errors internally
50
- $this->setXmlParseErrors(NULL);
51
- $xml_errors_setting = libxml_use_internal_errors(true);
52
-
53
- // The XML API response gets sent with content type text/html,
54
- // so decode the HTML entities before parsing
55
- $decoded_data = simplexml_load_string(utf8_encode(html_entity_decode($raw_response->getBody())));
56
-
57
- if ($decoded_data) {
58
- $this->setResponse($decoded_data);
59
- } else {
60
- $xml_errors = array();
61
- foreach (libxml_get_errors() as $error) {
62
- $xml_errors[] = preg_replace("/\n/", " ", $error->message);
63
- }
64
- $this->setXmlParseErrors($xml_errors);
65
- }
66
-
67
- // Reset libxml error settings
68
- libxml_clear_errors();
69
- libxml_use_internal_errors($xml_errors_setting);
70
-
71
- return $this;
72
- }
73
-
74
- public function getResponseXPath($xpath) {
75
- if ($this->hasResponse()) {
76
- return $this->getResponse()->xpath($xpath);
77
- } else {
78
- return NULL;
79
- }
80
- }
81
-
82
- /**
83
- * Get the API response status code. Return false if there
84
- * is no status code.
85
- *
86
- * @return int
87
- */
88
- public function getApiStatusCode() {
89
- $status_attribute_xpath = $this->getResponseXPath('/response/@status[1]');
90
- if (count($status_attribute_xpath) == 1) {
91
- $status_attribute = (string) $status_attribute_xpath[0];
92
- if (is_numeric($status_attribute)) {
93
- return (int) $status_attribute;
94
- }
95
- }
96
- return false;
97
- }
98
-
99
- /**
100
- * Return the description text for the given API response code. Returns
101
- * "Unknown" for unknown codes.
102
- *
103
- * @param int $code API response code
104
- *
105
- * @return string
106
- */
107
- public function getApiStatusCodeDescription($code) {
108
- if (isset(self::$status_code_descriptions[$code])) {
109
- return self::$status_code_descriptions[$code];
110
- }
111
-
112
- return "Unknown";
113
- }
114
-
115
- /**
116
- * Perform a check on the HTTP Status Code returned by the request and evaluate the status attribute of
117
- * the wrapping <response> element for a valid status code.
118
- *
119
- * @return bool
120
- */
121
- public function wasSuccessful() {
122
- if ($this->getResponse()) {
123
- $http_status_string = (string) $this->getHttpStatusCode();
124
-
125
- if (substr($http_status_string, 0, 1) == "2") {
126
- $api_status = $this->getApiStatusCode();
127
-
128
- if ($api_status !== false) {
129
- return $api_status == self::STATUS_SUCCESS;
130
- }
131
- }
132
- }
133
-
134
- return false;
135
- }
136
-
137
- /**
138
- * Choose and return the appropriate text error message for this request.
139
- * Returns false if the request was successful.
140
- *
141
- * @return bool|string
142
- */
143
- public function getErrorMessage() {
144
- $message = false;
145
-
146
- if (!$this->wasSuccessful()) {
147
- // Check for API status errors
148
- $api_status_code = $this->getApiStatusCode();
149
- if ($api_status_code !== false) {
150
- $message = $this->getApiStatusCodeDescription($api_status_code);
151
- } else {
152
- // Check for response parse errors
153
- $xml_parse_errors = $this->getXmlParseErrors();
154
- if (!empty($xml_parse_errors)) {
155
- $message = "Failed to parse the API response: " . implode(", ", $xml_parse_errors);
156
- } else {
157
- // Check for HTTP errors
158
- $http_status_code = $this->getHttpStatusCode();
159
- if (!is_null($http_status_code)) {
160
- $message = "HTTP Error: " . Zend_Http_Response::responseCodeAsText($http_status_code);
161
- } else {
162
- $message = "Unknown error";
163
- }
164
- }
165
- }
166
- }
167
-
168
- return $message;
169
- }
170
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Test/Config/Base.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- class Cloudiq_Core_Test_Config_Base extends EcomDev_PHPUnit_Test_Case_Config {
3
- /**
4
- * @test
5
- */
6
- public function testBasicConfiguration() {
7
- $this->assertModuleCodePool('community');
8
- $this->assertModuleVersion('1.0.0');
9
- }
10
-
11
- /**
12
- * @test
13
- */
14
- public function testClassAliases() {
15
- $this->assertHelperAlias('cloudiq_core', 'Cloudiq_Core_Helper_Data');
16
- $this->assertModelAlias('cloudiq_core/test', 'Cloudiq_Core_Model_Test');
17
- $this->assertBlockAlias('cloudiq_core/test', 'Cloudiq_Core_Block_Test');
18
- }
19
-
20
- /**
21
- * @test
22
- */
23
- public function testDataHelperExists() {
24
- $this->assertInstanceOf('Cloudiq_Core_Helper_Data', Mage::helper('cloudiq_core'));
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Test/Model/Api/Response.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
-
3
- class Cloudiq_Core_Test_Model_Api_Response extends Cloudiq_Core_Test_Model_Api_TestCase {
4
-
5
- /** @var Cloudiq_Core_Model_Api_Response */
6
- protected $_model;
7
-
8
- protected function setUp() {
9
- parent::setUp();
10
-
11
- $this->_model = Mage::getModel('cloudiq_core/api_response');
12
- }
13
-
14
- protected function tearDown() {
15
- parent::tearDown();
16
-
17
- $this->_model = null;
18
- }
19
-
20
- /**
21
- * @test
22
- */
23
- public function testClassConstruction() {
24
- $this->assertInstanceOf('Cloudiq_Core_Model_Api_Response', $this->_model);
25
- }
26
-
27
- /**
28
- * @test
29
- */
30
- public function testWasSuccessfulNoRequest() {
31
- $this->assertFalse($this->_model->wasSuccessful());
32
- }
33
-
34
- /**
35
- * @test
36
- */
37
- public function testWasSuccessfulStatusCodeAndResponseAttribute() {
38
- $successful_response = Zend_Http_Response::fromString($this->_loadFileContents('Response/testWasSuccessfulStatusCodeAndResponseAttribute.txt'));
39
-
40
- $this->_model->populate($successful_response);
41
-
42
- $this->assertTrue($this->_model->wasSuccessful());
43
- }
44
-
45
- /**
46
- * @test
47
- */
48
- public function testWasSuccessfulBadResponseAttribute() {
49
- $bad_response = Zend_Http_Response::fromString($this->_loadFileContents('Response/testWasSuccessfulBadResponseAttribute.txt'));
50
-
51
- $this->_model->populate($bad_response);
52
-
53
- $this->assertFalse($this->_model->wasSuccessful());
54
- }
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Test/Model/Api/TestCase.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- abstract class Cloudiq_Core_Test_Model_Api_TestCase extends EcomDev_PHPUnit_Test_Case {
3
- /**
4
- * @param string $http_method
5
- * @param int $status_code
6
- * @param string $response_filename
7
- *
8
- * @return PHPUnit_Framework_MockObject_MockObject
9
- */
10
- public function getRequestMock($http_method, $status_code, $response_filename) {
11
- $file_contents = $this->_loadFileContents($response_filename);
12
-
13
- $this->assertNotNull($file_contents);
14
- $this->assertNotEmpty($file_contents);
15
-
16
- /** @var $response Cloudiq_Core_Model_Api_Response */
17
- $response = Mage::getModel('cloudiq_core/api_response');
18
- $response
19
- ->setStatusCode($status_code)
20
- ->setRawResponse($file_contents);
21
-
22
- $request_mock = $this->getModelMock('cloudiq_core/api_request', array('send'));
23
-
24
- $request_mock
25
- ->expects($this->once())
26
- ->method('send')
27
- ->with($this->equalTo($http_method))
28
- ->will($this->returnValue($response));
29
-
30
- return $request_mock;
31
- }
32
-
33
- protected function _loadFileContents($file) {
34
- $directory_tree = array(
35
- Mage::getModuleDir('', 'Cloudiq_Core'),
36
- 'Test',
37
- 'Model',
38
- 'Api',
39
- 'data',
40
- $file
41
- );
42
-
43
- $file_path = join(DS, $directory_tree);
44
-
45
- return file_get_contents($file_path);
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Test/Model/Api/data/Response/testWasSuccessfulBadResponseAttribute.txt DELETED
@@ -1,15 +0,0 @@
1
- HTTP/1.1 403 Forbidden
2
- Date: Tue, 18 Jun 2013 11:46:25 GMT
3
- Server: Apache-Coyote/1.1
4
- X-powered-by: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
5
- Content-type: text/xml;charset=ISO-8859-1
6
- Content-length: 201
7
- Via: 1.1 nimbus.cloud-iq.com
8
- Connection: close
9
-
10
- <?xml version="1.0" encoding="utf-8" ?>
11
- <response status="101">
12
- <description>Authentication failure</description>
13
- <requestId>273025</requestId>
14
- <dateTime>2013-06-18T11:46:25Z</dateTime>
15
- </response>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/Test/Model/Api/data/Response/testWasSuccessfulStatusCodeAndResponseAttribute.txt DELETED
@@ -1,16 +0,0 @@
1
- HTTP/1.1 202 Accepted
2
- Date: Tue, 18 Jun 2013 11:30:50 GMT
3
- Server: Apache-Coyote/1.1
4
- X-powered-by: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
5
- Content-type: text/html;charset=ISO-8859-1
6
- Content-length: 914
7
- Via: 1.1 nimbus.cloud-iq.com
8
- Connection: close
9
-
10
- <?xml version="1.0" encoding="utf-8" ?>
11
- <response status="1">
12
- <description>Success</description>
13
- <requestId>273005</requestId>
14
- <dateTime>2013-06-18T11:30:50Z</dateTime>
15
- <timeZone>GMT</timeZone>
16
- </response>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/controllers/Adminhtml/CloudiqController.php DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
- class Cloudiq_Core_Adminhtml_CloudiqController extends Mage_Adminhtml_Controller_Action {
3
- public function editAction() {
4
- $this->loadLayout();
5
- $this->_setActiveMenu('cloudiq');
6
- $this->renderLayout();
7
- }
8
-
9
- public function saveAction() {
10
- Mage::dispatchEvent("cloudiq_core_config_save", array('request'=>$this->getRequest()));
11
-
12
- $request = $this->getRequest();
13
- $form_data = new Varien_Object($request->getParam("global"));
14
-
15
- if (count($form_data->getData()) > 0) {
16
- // Save global Cloud.IQ config data to system config
17
-
18
- $account_id = trim($form_data->getData("account_id"));
19
- $token = trim($form_data->getData("token"));
20
- $enabled = ($form_data->getData("enabled")) ? 1 : 0;
21
-
22
- // Validate the form fields
23
- $validation_errors = 0;
24
-
25
- if ($account_id == "") {
26
- $validation_errors++;
27
- Mage::getSingleton("adminhtml/session")->addError($this->__("cloud.IQ: Account ID can not be empty."));
28
- }
29
-
30
- if ($token == "") {
31
- $validation_errors++;
32
- Mage::getSingleton("adminhtml/session")->addError($this->__("cloud.IQ: Token can not be empty."));
33
- }
34
-
35
- if ($validation_errors == 0 && $enabled) {
36
- // Check if the account is valid using the API
37
- $result = Mage::getModel("cloudiq_core/api_core")->lookupAccount($account_id, $token);
38
- if ($result["status"] !== true) {
39
- $validation_errors++;
40
- Mage::getSingleton("adminhtml/session")->addError(sprintf("%s: %s", $this->__("cloud.IQ: The account credentials provided could not be verified"), $this->__($result["content"])));
41
- }
42
- }
43
-
44
- if ($validation_errors == 0) {
45
- // Save configuration to system config
46
- $_system_config = Mage::getConfig();
47
-
48
- $_system_config->saveConfig("cloudiq_core/global/account_id", $account_id);
49
- $_system_config->saveConfig("cloudiq_core/global/token", $token);
50
-
51
- $_system_config->saveConfig("cloudiq_core/global/enabled", $enabled);
52
-
53
- Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("cloudiq_core")->__("Global configuration saved."));
54
-
55
- // Reload system config, so changes are picked up
56
- $_system_config->reinit();
57
- Mage::app()->reinitStores();
58
- }
59
- }
60
-
61
- // Redirect back to the form, preserving any params (such as active tab)
62
- $this->_redirect("*/*/edit", array("_current" => true));
63
- }
64
-
65
- public function frameAction() {
66
- $_config_helper = Mage::helper("cloudiq_core/config");
67
-
68
- $module = $this->getRequest()->getParam("module");
69
- $profile_id = $this->getRequest()->getParam("profile_id");
70
-
71
- $destination = $_config_helper->getCloudiqUrl($module, ($profile_id != null) ? $profile_id : null);
72
-
73
- $additional_parameters = array();
74
-
75
- // Pre-populate the sign up form with current user details
76
- if ($module == "signUp") {
77
- /** @var $user Mage_Admin_Model_User */
78
- $user = Mage::getSingleton('admin/session')->getUser();
79
- $additional_parameters["username"] = $user->getEmail();
80
- $additional_parameters["fullName"] = $user->getName();
81
- }
82
-
83
- $this->getResponse()->setBody(
84
- $this->getLayout()->createBlock("core/template", "")
85
- ->setTemplate("cloudiq/core/tab/frame/submitter.phtml")
86
- ->setDestination($destination)
87
- ->setAccountId($_config_helper->getAccountId())
88
- ->setToken($_config_helper->getToken())
89
- ->setAdditionalParameters($additional_parameters)
90
- ->toHtml()
91
- );
92
- }
93
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/etc/adminhtml.xml DELETED
@@ -1,31 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <config>
3
- <menu>
4
- <cloudiq translate="title" module="cloudiq_core">
5
- <title>cloud.IQ</title>
6
- <sort_order>900</sort_order>
7
- <action>adminhtml/cloudiq/edit</action>
8
- </cloudiq>
9
- </menu>
10
- <acl>
11
- <resources>
12
- <admin>
13
- <children>
14
- <system>
15
- <children>
16
- <config>
17
- <children>
18
- <cloudiq_core translate="title">
19
- <title>cloud.IQ Section</title>
20
- <sort_order>60</sort_order>
21
- </cloudiq_core>
22
- </children>
23
- </config>
24
- </children>
25
- </system>
26
- </children>
27
- </admin>
28
- </resources>
29
- </acl>
30
- </config>
31
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Cloudiq/Core/etc/config.xml DELETED
@@ -1,70 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
-
4
- <modules>
5
- <Cloudiq_Core>
6
- <version>1.0.0</version>
7
- </Cloudiq_Core>
8
- </modules>
9
-
10
- <global>
11
- <blocks>
12
- <cloudiq_core>
13
- <class>Cloudiq_Core_Block</class>
14
- </cloudiq_core>
15
- </blocks>
16
- <models>
17
- <cloudiq_core>
18
- <class>Cloudiq_Core_Model</class>
19
- </cloudiq_core>
20
- </models>
21
- <helpers>
22
- <cloudiq_core>
23
- <class>Cloudiq_Core_Helper</class>
24
- </cloudiq_core>
25
- </helpers>
26
- </global>
27
-
28
- <frontend>
29
- <routers>
30
- <cloudiq>
31
- <use>standard</use>
32
- <args>
33
- <frontName>cloudiq</frontName>
34
- <module>Cloudiq_Core</module>
35
- </args>
36
- </cloudiq>
37
- </routers>
38
- </frontend>
39
-
40
- <admin>
41
- <routers>
42
- <adminhtml>
43
- <args>
44
- <modules>
45
- <cloudiq_core before="Mage_Adminhtml">Cloudiq_Core_Adminhtml</cloudiq_core>
46
- </modules>
47
- </args>
48
- </adminhtml>
49
- </routers>
50
- </admin>
51
-
52
- <adminhtml>
53
- <layout>
54
- <updates>
55
- <cloudiq_core>
56
- <file>cloudiq/core.xml</file>
57
- </cloudiq_core>
58
- </updates>
59
- </layout>
60
- </adminhtml>
61
-
62
- <phpunit>
63
- <suite>
64
- <modules>
65
- <Cloudiq_Core />
66
- </modules>
67
- </suite>
68
- </phpunit>
69
-
70
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/layout/cloudiq/core.xml DELETED
@@ -1,50 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout>
3
- <default>
4
- <reference name="head">
5
- <action method="addCss"><stylesheet>cloudiq/core.css</stylesheet></action>
6
- </reference>
7
- </default>
8
- <adminhtml_cloudiq_edit>
9
- <reference name="content">
10
- <block type="cloudiq_core/adminhtml_config_edit" name="cloudiq.config.edit"/>
11
- </reference>
12
- <reference name="left">
13
- <block type="cloudiq_core/adminhtml_config_edit_tabs" name="cloudiq.config.edit.tabs">
14
- <block type="cloudiq_core/adminhtml_config_edit_tab_global" name="cloudiq.config.edit.tab.global"/>
15
- <action method="addTab">
16
- <name>global_section</name>
17
- <block>cloudiq.config.edit.tab.global</block>
18
- </action>
19
- <block type="cloudiq_core/adminhtml_config_edit_tab_frame" name="cloudiq.config.edit.tab.dashboard">
20
- <action method="setLabel"><label>Dashboard</label></action>
21
- <action method="setModule"><module>dashboard</module></action>
22
- <action method="setTabName"><name>dashboard_section</name></action>
23
- </block>
24
- <action method="addTab">
25
- <name>dashboard_section</name>
26
- <block>cloudiq.config.edit.tab.dashboard</block>
27
- </action>
28
- <block type="cloudiq_core/adminhtml_config_edit_tab_frame" name="cloudiq.config.edit.tab.account">
29
- <action method="setLabel"><label>Account</label></action>
30
- <action method="setModule"><module>account</module></action>
31
- <action method="setTabName"><name>account_section</name></action>
32
- </block>
33
- <action method="addTab">
34
- <name>account_section</name>
35
- <block>cloudiq.config.edit.tab.account</block>
36
- </action>
37
- <block type="cloudiq_core/adminhtml_config_edit_tab_frame" name="cloudiq.config.edit.tab.support">
38
- <action method="setLabel"><label>Support</label></action>
39
- <action method="setModule"><module>support</module></action>
40
- <action method="setTabName"><name>support_section</name></action>
41
- </block>
42
- <action method="addTab">
43
- <name>support_section</name>
44
- <block>cloudiq.config.edit.tab.support</block>
45
- </action>
46
- </block>
47
- </reference>
48
- </adminhtml_cloudiq_edit>
49
- </layout>
50
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/cloudiq/core/tab/frame/iframe.phtml DELETED
@@ -1,11 +0,0 @@
1
- <iframe id="<?php echo $this->getFrameId(); ?>" src="<?php echo $this->getSubmitterUrl(); ?>" frameborder="0" width="100%" height="787px"></iframe>
2
- <script type="text/javascript">
3
- document.observe("dom:loaded", function () {
4
- varienGlobalEvents.attachEventHandler("showTab", function (event) {
5
- if (event.tab.name == "<?php echo $this->getTabName(); ?>") {
6
- var frame = $('<?php echo $this->getFrameId(); ?>');
7
- frame.src = frame.src; // Reload frame
8
- }
9
- });
10
- });
11
- </script>
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/cloudiq/core/tab/frame/submitter.phtml DELETED
@@ -1,11 +0,0 @@
1
- <form action="<?php echo $this->getDestination(); ?>" method="POST">
2
- <input type="hidden" name="id" value="<?php echo $this->getAccountId(); ?>" />
3
- <input type="hidden" name="token" value="<?php echo $this->getToken() ?>" />
4
- <?php $additional_parameters = $this->getAdditionalParameters(); ?>
5
- <?php foreach ($additional_parameters as $name => $value): ?>
6
- <input type="hidden" name="<?php echo $name; ?>" value="<?php echo $value; ?>" />
7
- <?php endforeach; ?>
8
- </form>
9
- <script type="text/javascript">
10
- document.forms[0].submit();
11
- </script>
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/cloudiq/core/tabs.phtml DELETED
@@ -1,39 +0,0 @@
1
- <?php if($this->getTitle()): ?>
2
- <h3><?php echo $this->getTitle() ?></h3>
3
- <?php endif ?>
4
- <?php if(!empty($tabs)): ?>
5
- <ul id="<?php echo $this->getId() ?>" class="tabs">
6
- <?php foreach ($tabs as $_tab): ?>
7
- <?php if (!$this->canShowTab($_tab)): continue; endif; ?>
8
- <li <?php if($this->getTabIsHidden($_tab)): ?> style="display:none"<?php endif; ?>>
9
- <a href="<?php echo $this->getTabUrl($_tab) ?>" id="<?php echo $this->getTabId($_tab) ?>" name="<?php echo $this->getTabId($_tab, false) ?>" title="<?php echo $this->getTabTitle($_tab) ?>" class="tab-item-link <?php echo $this->getTabClass($_tab) ?><?php if (preg_match('/\s?ajax\s?/', $_tab->getClass())) {?> notloaded<?php }?>">
10
- <span><span class="changed" title="<?php echo $this->__('The information in this tab has been changed.') ?>"></span><span class="error" title="<?php echo $this->__('This tab contains invalid data. Please solve the problem before saving.') ?>"></span><?php echo $this->getTabLabel($_tab); ?></span>
11
- </a>
12
- <div id="<?php echo $this->getTabId($_tab) ?>_content" style="display:none;"><?php echo $this->getTabContent($_tab) ?></div>
13
- </li>
14
- <?php endforeach; ?>
15
- </ul>
16
- <script type="text/javascript">
17
- <?php echo $this->getJsObjectName() ?> = new varienTabs('<?php echo $this->getId() ?>', '<?php echo $this->getDestElementId() ?>', '<?php echo $this->getActiveTabId() ?>', <?php echo $this->getAllShadowTabs()?>);
18
- </script>
19
- <script type="text/javascript">
20
- document.observe("dom:loaded", function() {
21
- var varien_tabs = <?php echo $this->getJsObjectName() ?>;
22
- var original_url = $('edit_form').action;
23
-
24
- $$('.form-buttons .save').each(function(element) {
25
- element.onclick = function (e) {
26
- var new_url = original_url;
27
- if (original_url.substr(-1,1) != "/") {
28
- new_url = new_url + "/";
29
- }
30
- new_url = new_url + "active_tab/" + varien_tabs.activeTab.name + "/";
31
-
32
- $('edit_form').action = new_url;
33
-
34
- editForm.submit();
35
- }
36
- });
37
- });
38
- </script>
39
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/cloudiq/global/tab.phtml DELETED
@@ -1 +0,0 @@
1
- TODO
 
app/design/adminhtml/default/default/template/cloudiq/global/widget/form.phtml DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- /**
3
- * Form template for the Global Settings tab of the configuration
4
- * form for Cloudiq_Core module.
5
- *
6
- * Based on default/default/template/widget/form.phtml
7
- */
8
- ?>
9
- <div class="entry-edit">
10
- <?php if (!$this->hasBeenSetUp()) : ?>
11
- <iframe src="<?php echo $this->getSetupUrl() ?>" frameborder="0" width="100%" height="600"></iframe>
12
- <?php endif; ?>
13
- <?php echo $this->getFormHtml();?>
14
- </div>
15
- <?php echo $this->getChildHtml('form_after');?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/Cloudiq_Core.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Cloudiq_Core>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </Cloudiq_Core>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>cloudiq</name>
4
- <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.cloud-iq.com">Commercial License</license>
7
  <channel>community</channel>
@@ -12,11 +12,11 @@
12
  The callMe extension installs a callMe button on your Magento store. It&#x2019;s beautifully simple to install and use.&#xD;
13
  &#xD;
14
  Your visitors can then conveniently input their telephone number for an immediate call back, the service will immediately call you (the business) then instantly connect the customer when you pick up the phone!</description>
15
- <notes>Fixed bugs with using the callMe button on a secure URL.</notes>
16
  <authors><author><name>cloud.IQ</name><user>cloud_iq</user><email>sales@cloud-iq.com</email></author></authors>
17
- <date>2013-07-30</date>
18
- <time>13:51:30</time>
19
- <contents><target name="mageetc"><dir name="modules"><file name="Cloudiq_Callme.xml" hash="e41b3685af06770ec59c90fb9dff6760"/><file name="Cloudiq_Core.xml" hash="cad973564b5dda06d3608f7e51d529e6"/></dir></target><target name="magecommunity"><dir name="Cloudiq"><dir name="Callme"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Edit"><dir name="Tab"><file name="Callme.php" hash="47fd8bc74ab111de5a4470657038d423"/></dir></dir></dir></dir><file name="Button.php" hash="d333cef499a50e4bcc969beb7f343f28"/></dir><dir name="Helper"><file name="Data.php" hash="85b0f590edbd071dadd4dd69f47cf768"/><file name="Options.php" hash="44da04907ac960c206b12c84bdc54850"/></dir><dir name="Model"><dir name="Api"><file name="Callme.php" hash="bf45783b4168869d4bcf9038b2970a8f"/></dir><file name="Config.php" hash="123f7f5b8fc0161e9e94e1c97de74b79"/><file name="Observer.php" hash="30062e5862e8901eb019f9542070c2b0"/><dir name="Resource"><dir name="Config"><file name="Collection.php" hash="c8cb34ede9c8c4ea692a560b47b27025"/></dir><file name="Config.php" hash="f8dfebe59e9f34ee306ea29f188e7bf2"/></dir></dir><dir name="Test"><dir name="Config"><file name="Base.php" hash="8b8b866e1321e1e98e7a4f36a59d2183"/></dir><dir name="Controller"><dir name="Block"><dir name="fixtures"><file name="testCallmeDisabled.yaml" hash="64621424e49f70f56b13857b28268200"/><file name="testCoreDisabled.yaml" hash="4731e31d6f73894232475d7ccbcb7758"/><file name="testDisplayOnAllPages.yaml" hash="81dbaa7b53e28e5d7e5875274dad6ef8"/></dir><dir name="providers"><file name="testDisplayOnAllPages.yaml" hash="c5fb386e2508b360bec626b5acad1076"/></dir></dir><file name="Block.php" hash="87b31a5aa9f2eb7f94f82c4affb9fad9"/></dir><dir name="Helper"><file name="Options.php" hash="431d9ab9633efdbdd0df9ec6e22af9fc"/></dir><dir name="Model"><dir name="Config"><dir name="fixtures"><file name="validConfigObject.yaml" hash="ead7a835c645cbba6e4effe3bc00d864"/></dir><dir name="providers"><file name="testOptionalField.yaml" hash="f253cd136bd4ceacc5f3e07dc936f7db"/><file name="testRequiredField.yaml" hash="63ec4c95468c32b0646eb8e8360097de"/></dir></dir><file name="Config.php" hash="a9b14a2e23922d9638fa12959b1384fb"/></dir></dir><dir name="Varien"><dir name="Data"><dir name="Form"><dir name="Element"><file name="Colourpicker.php" hash="b2f796c6b776291d4820dd355bcd1f7c"/><file name="Openinghours.php" hash="2378bfe07e017eb6e0053443562bbea9"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CallmeController.php" hash="9bc2d43037ea553ee980e32813f17c99"/></dir><file name="CallmeController.php" hash="a34309a5230ed5cb616a22cc4a0b8b62"/></dir><dir name="etc"><file name="config.xml" hash="f4ed064ec1c5375313ef559b3b8af5b5"/></dir><dir name="sql"><dir name="cloudiq_callme_setup"><file name="mysql4-install-1.0.0.php" hash="565324b929bcd1cce3813bfbd146a392"/></dir></dir></dir><dir name="Core"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Edit"><file name="Form.php" hash="adb6a7430c073ee2930b4d853fb4cfa3"/><dir name="Tab"><file name="Frame.php" hash="f95557ef75baf8aa41468bc7fb68a392"/><file name="Global.php" hash="46e016a82d206ead0190b45a160df00d"/></dir><file name="Tabs.php" hash="953109aea9e43c0dd960eb9f2aa041f6"/></dir><file name="Edit.php" hash="55f27f8954981871bd7e748f48f9e8c0"/></dir></dir></dir><dir name="Helper"><file name="Config.php" hash="37bd1633ce962c654f0e21818991c191"/><file name="Data.php" hash="528460cf7ec9f942f2f29f6dad1c52f1"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="a6df29a5d90cba70242cd36bd0689cd3"/><file name="Core.php" hash="a1c7cfb04097677e5565ce496d558e94"/><file name="Request.php" hash="43bd7500c74d97eac224c23518e3824b"/><file name="Response.php" hash="b977b0f632a7bafa40b52d8d9e0078ac"/></dir></dir><dir name="Test"><dir name="Config"><file name="Base.php" hash="f2e2ca2e59d14048bf46b8c208787793"/></dir><dir name="Model"><dir name="Api"><file name="Response.php" hash="e9d5051331fabfcbe487778ae2c47cc3"/><file name="TestCase.php" hash="2d5114ea542aba75f666b6254390a5d6"/><dir name="data"><dir name="Response"><file name="testWasSuccessfulBadResponseAttribute.txt" hash="7edb6a3d909e8bfb7f04a3450b0fc1c8"/><file name="testWasSuccessfulStatusCodeAndResponseAttribute.txt" hash="14b598d1a6abd984d00cb76fa5351b81"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CloudiqController.php" hash="4cdb6fc9daf31260c6e020496f7ba557"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8ee43c9b6d84378c552987e7e980a50d"/><file name="config.xml" hash="d53122159940a78b5f8352355c9f0f99"/></dir><file name=".gitkeep" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="cloudiq"><file name="callme.xml" hash="93aae78cddc91367219762316cf50f9c"/><file name="core.xml" hash="f5fe732a5efecaffea2a1ad98f595a6d"/></dir></dir><dir name="template"><dir name="cloudiq"><dir name="core"><dir name="tab"><dir name="frame"><file name="iframe.phtml" hash="70e60d46b58138986b555b96c9f87dc5"/><file name="submitter.phtml" hash="d0c0dcb6206dd9298630dc564016e24f"/></dir></dir><file name="tabs.phtml" hash="a14de21a37b43d13b4e70b9ef96933c7"/></dir><dir name="global"><file name="tab.phtml" hash="9b7105f44b18bc0d5649658e6e111aaa"/><dir name="widget"><file name="form.phtml" hash="d91ea0fc9b1b2d48068732a3f203610c"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="cloudiq"><dir name="callme"><file name="button.phtml" hash="ffb7f2832f2c168ec787c59857c122be"/></dir></dir></dir><dir name="layout"><dir name="cloudiq"><file name="callme.xml" hash="74aec1e1170e588b108d7a1176eaf9a4"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="cloudiq"><file name="callme.css" hash="a355859aec05b9d485f3f9287eb862be"/><file name="core.css" hash="c22a2fe861358447637a640e75da9076"/><dir name="js"><file name="callme.js" hash="4007f758fde195875608fcaf32f23a7f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="cloudiq"><dir name="css"><file name="callme-button.css" hash="048f2a083509251e9a0ca7999221ea17"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="cloudiq"><file name="callme-button.js" hash="42de2870222b7b96062a063b1216685c"/><dir name="callme-jscolor"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="demo.html" hash="edf71251cb2be20322d2efb00aee86a6"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="b65a1505390592ac6c0177d6b84774e0"/></dir></dir></dir></target><target name="magelocale"><dir name="en_GB"><file name="Cloudiq_Callme.csv" hash="a056a4403ab97dc4308b9b84a8bcfcfd"/></dir></target></contents>
20
  <compatible/>
21
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>cloudiq</name>
4
+ <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.cloud-iq.com">Commercial License</license>
7
  <channel>community</channel>
12
  The callMe extension installs a callMe button on your Magento store. It&#x2019;s beautifully simple to install and use.&#xD;
13
  &#xD;
14
  Your visitors can then conveniently input their telephone number for an immediate call back, the service will immediately call you (the business) then instantly connect the customer when you pick up the phone!</description>
15
+ <notes>Move the Cloudiq_Core framework into a separate package.</notes>
16
  <authors><author><name>cloud.IQ</name><user>cloud_iq</user><email>sales@cloud-iq.com</email></author></authors>
17
+ <date>2013-09-09</date>
18
+ <time>10:29:27</time>
19
+ <contents><target name="mageetc"><dir name="modules"><file name="Cloudiq_Callme.xml" hash="e41b3685af06770ec59c90fb9dff6760"/></dir></target><target name="magecommunity"><dir name="Cloudiq"><dir name="Callme"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Edit"><dir name="Tab"><file name="Callme.php" hash="33fe695c100cb309a2b5dd6a7074ed58"/></dir></dir></dir></dir><file name="Button.php" hash="d333cef499a50e4bcc969beb7f343f28"/></dir><dir name="Helper"><file name="Data.php" hash="85b0f590edbd071dadd4dd69f47cf768"/><file name="Options.php" hash="44da04907ac960c206b12c84bdc54850"/></dir><dir name="Model"><dir name="Api"><file name="Callme.php" hash="bf45783b4168869d4bcf9038b2970a8f"/></dir><file name="Config.php" hash="123f7f5b8fc0161e9e94e1c97de74b79"/><file name="Observer.php" hash="30062e5862e8901eb019f9542070c2b0"/><dir name="Resource"><dir name="Config"><file name="Collection.php" hash="c8cb34ede9c8c4ea692a560b47b27025"/></dir><file name="Config.php" hash="f8dfebe59e9f34ee306ea29f188e7bf2"/></dir></dir><dir name="Test"><dir name="Config"><file name="Base.php" hash="8b8b866e1321e1e98e7a4f36a59d2183"/></dir><dir name="Controller"><dir name="Block"><dir name="fixtures"><file name="testCallmeDisabled.yaml" hash="64621424e49f70f56b13857b28268200"/><file name="testCoreDisabled.yaml" hash="4731e31d6f73894232475d7ccbcb7758"/><file name="testDisplayOnAllPages.yaml" hash="81dbaa7b53e28e5d7e5875274dad6ef8"/></dir><dir name="providers"><file name="testDisplayOnAllPages.yaml" hash="c5fb386e2508b360bec626b5acad1076"/></dir></dir><file name="Block.php" hash="a3d3e0b9749e273953d147bbd816d6f1"/></dir><dir name="Helper"><file name="Options.php" hash="431d9ab9633efdbdd0df9ec6e22af9fc"/></dir><dir name="Model"><dir name="Config"><dir name="fixtures"><file name="validConfigObject.yaml" hash="ead7a835c645cbba6e4effe3bc00d864"/></dir><dir name="providers"><file name="testOptionalField.yaml" hash="f253cd136bd4ceacc5f3e07dc936f7db"/><file name="testRequiredField.yaml" hash="63ec4c95468c32b0646eb8e8360097de"/></dir></dir><file name="Config.php" hash="a9b14a2e23922d9638fa12959b1384fb"/></dir></dir><dir name="Varien"><dir name="Data"><dir name="Form"><dir name="Element"><file name="Colourpicker.php" hash="b2f796c6b776291d4820dd355bcd1f7c"/><file name="Openinghours.php" hash="2378bfe07e017eb6e0053443562bbea9"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CallmeController.php" hash="9bc2d43037ea553ee980e32813f17c99"/></dir><file name="CallmeController.php" hash="a34309a5230ed5cb616a22cc4a0b8b62"/></dir><dir name="etc"><file name="config.xml" hash="f4ed064ec1c5375313ef559b3b8af5b5"/></dir><dir name="sql"><dir name="cloudiq_callme_setup"><file name="mysql4-install-1.0.0.php" hash="565324b929bcd1cce3813bfbd146a392"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="cloudiq"><file name="callme.xml" hash="93aae78cddc91367219762316cf50f9c"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="cloudiq"><file name="callme.xml" hash="74aec1e1170e588b108d7a1176eaf9a4"/></dir></dir><dir name="template"><dir name="cloudiq"><dir name="callme"><file name="button.phtml" hash="ffb7f2832f2c168ec787c59857c122be"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_GB"><file name="Cloudiq_Callme.csv" hash="a056a4403ab97dc4308b9b84a8bcfcfd"/></dir></target><target name="mageweb"><dir name="js"><dir name="cloudiq"><file name="callme-button.js" hash="42de2870222b7b96062a063b1216685c"/><dir name="callme-jscolor"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="demo.html" hash="edf71251cb2be20322d2efb00aee86a6"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="b65a1505390592ac6c0177d6b84774e0"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="cloudiq"><file name="callme.css" hash="a355859aec05b9d485f3f9287eb862be"/><dir name="js"><file name="callme.js" hash="4007f758fde195875608fcaf32f23a7f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="cloudiq"><dir name="css"><file name="callme-button.css" hash="048f2a083509251e9a0ca7999221ea17"/></dir></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Cloudiq_Core</name><channel>community</channel><min>1.0.0</min><max/></package></required></dependencies>
22
  </package>
skin/adminhtml/default/default/cloudiq/core.css DELETED
@@ -1,41 +0,0 @@
1
- .cloudiq-banner {
2
- padding: 5px 27px 5px 47px;
3
- background: rgb(255, 249, 233);
4
- border-bottom: 1px solid rgb(238, 226, 190);
5
- border-top: 1px solid rgb(238, 226, 190);
6
- font-size: 11px;
7
- line-height: 16px;
8
- margin: 0 0 -3px;
9
- color: rgb(68, 68, 68);
10
- position: relative;
11
- }
12
-
13
- /*
14
- * Expand the config form and adjust all elements to expand to the new size.
15
- */
16
- #edit_form .form-list {
17
- width: 590px;
18
- }
19
-
20
- #edit_form .form-list td.value {
21
- width: auto;
22
- }
23
-
24
- #edit_form td.value .note {
25
- width: 90%;
26
- }
27
-
28
- #edit_form td.value select {
29
- width: 95%;
30
- }
31
-
32
- /* Text inputs are half-width by default */
33
- #edit_form td.value input {
34
- width: 50%;
35
- }
36
-
37
- /* Expand the Account ID and Token fields to fit the data */
38
- #edit_form #settings.fieldset td.value input {
39
- font-family: monospace;
40
- width: 64%;
41
- }