Permalink
Browse files

Initial Commit

  • Loading branch information...
0 parents commit c5f7018cb1a2fb5b7f53254e1ab15436a29d2116 Jesse Schutt committed Mar 28, 2011
@@ -0,0 +1,20 @@
+<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+
+/**
+ * HelpMe Config
+ *
+ * @package HelpMe
+ * @subpackage Config
+ * @copyright Copyright (c) 2011, Jesse Schutt
+ * @author TrinitySTUDIOS
+ * @license
+ * @link
+ */
+
+ /**
+ * Set to TRUE if you are using GoDaddy.
+ */
+$config['godaddy_mode'] = FALSE;
+
+/* End of file helpme_config.php */
+/* Location: ./third_party/helpme/config/helpme_config.php */
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>403 Forbidden</title>
+</head>
+<body>
+
+<p>Directory access is forbidden.</p>
+
+</body>
+</html>
@@ -0,0 +1,17 @@
+var Helpme = {};
+
+Helpme.check = function() {
+ if ( ! jQuery) {
+ setTimeout('Helpme.check()', 10);
+ } else {
+ Helpme.init();
+ }
+}
+
+Helpme.init = function() {
+ jQuery.noConflict();
+ jQuery("a.mojo_sub_page[title='Help']").attr('href', "index.php/admin/addons/helpme/view/");
+
+}
+
+setTimeout('Helpme.check()', 10);
@@ -0,0 +1,282 @@
+<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * Helpme - Site Specific Help
+ *
+ * @package MojoMotor
+ * @subpackage Addons
+ * @author Jesse Schutt
+ * @license Apache License v2.0
+ * @copyright 2011 Jesse Schutt
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+class Helpme
+{
+ var $addon;
+
+ var $helpme_version = '.1b';
+
+ var $dev_name = 'Developer\'s Name';
+ var $support_email = 'jesse@trinity-studios.com';
+ var $support_website = 'http://www.trinity-studios.com';
+
+ var $dependencies_loaded = FALSE;
+
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ *
+ * @access public
+ * @return void
+ */
+function __construct()
+{
+ $this->addon =& get_instance();
+
+ $this->addon->load->config('helpme_config');
+
+ // -------------------------------------
+ // Get the MM version
+ // -------------------------------------
+
+ $this->addon->load->Database();
+
+ $this->addon->load->library('Security');
+
+ // -------------------------------------
+ // Dip out for CSS/JS
+ // - this is from MojoBlocks
+ // -------------------------------------
+
+ $method = $this->addon->uri->segment( 4 );
+
+ if( $method == 'css' || $method == 'js' || $method == 'images' ):
+
+ $call_method = '_'.$method;
+
+ $this->$call_method();
+
+ die();
+
+ endif;
+
+ // -------------------------------------
+ // Loading JS and CSS
+ // - this is from MojoBlocks
+ // -------------------------------------
+ if( $this->addon->session->userdata('group_id') ):
+
+ if( $this->dependencies_loaded == FALSE ):
+
+ $assets = $this->_helpme_dependencies();
+
+ foreach( $assets as $asset ):
+
+ $this->addon->cp->appended_output[] = $asset;
+
+ endforeach;
+
+ $this->dependencies_loaded = TRUE;
+
+ endif;
+
+ endif;
+}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Returns JS and CSS needs for HelpMe.
+ *
+ * @access private
+ * @return array
+ */
+ function _helpme_dependencies()
+ {
+ $dependencies[] = '<link type="text/css" rel="stylesheet" href="'.site_url('addons/helpme/css/helpme.css').'" /> ';
+ $dependencies[] = '<script charset="utf-8" type="text/javascript" src="'.site_url('admin/addons/helpme/js/helpme.js').'"></script>';;
+
+ return $dependencies;
+ }
+
+ // ------------------------------------------------------------------------
+
+ /**
+ * Starts the process to update the help page.
+ *
+ * @access public
+ * @param array
+ * @return string
+ */
+ public function please($template_data = array())
+ {
+ }
+
+ // ------------------------------------------------------------------------
+
+ /**
+ * This pulls in the view file and overrides the existing help page
+ *
+ * @access public
+ * @return string Outputs the file
+ */
+
+ public function view()
+ {
+ $data = array();
+
+ $this->addon->load->model('site_model');
+
+ $data['dev_name'] = $this->dev_name;
+ $data['support_email'] = $this->support_email;
+ $data['support_website'] = $this->support_website;
+ $data['helpme_version'] = $this->helpme_version;
+ $data['version'] = $this->addon->site_model->get_setting('mojo_version');
+ $data['language'] = $this->addon->config->item('language');
+
+ echo $this->_load_view('views/index', $data);
+ }
+
+
+ /**
+ * Loads a view.
+ *
+ * @access private
+ * @param string The view to load MUST include the folder (i.e. views/index)
+ * @param array The data view
+ * @param bool Where to return the results
+ * @return string The View contents
+ */
+ private function _load_view($view, $data = array(), $return = TRUE)
+ {
+ $orig_view_path = $this->addon->load->_ci_view_path;
+ $this->addon->load->_ci_view_path = APPPATH.'third_party/helpme/';
+
+ $return = $this->addon->load->view($view, $data, $return);
+
+ $this->addon->load->_ci_view_path = $orig_view_path;
+
+ return $return;
+ }
+ // --------------------------------------------------------------------
+
+
+
+
+ /**
+ * Output a JS file. Just like that.
+ *
+ * @access private
+ * @return js
+ */
+ function _js()
+ {
+ header("Content-Type: text/javascript");
+
+ // GoDaddy mode check
+
+ if( $this->addon->config->item('godaddy_mode') ):
+
+ $filename = str_replace('_', '.', $this->addon->uri->segment(5));
+
+ else:
+
+ $filename = $this->addon->uri->segment(5);
+
+ endif;
+
+ $file = $this->addon->security->sanitize_filename($this->addon->uri->segment(5));
+
+ echo @file_get_contents( APPPATH . 'third_party/helpme/js/'.$file);
+
+ }
+
+ // --------------------------------------------------------------------
+
+
+ /**
+ * Output a IMG file.
+ *
+ * @access private
+ * @return img
+ */
+ function _images()
+ {
+ // GoDaddy mode check
+
+ if( $this->addon->config->item('godaddy_mode') ):
+
+ $filename = str_replace('_', '.', $this->addon->uri->segment(5));
+
+ else:
+
+ $filename = $this->addon->uri->segment(5);
+
+ endif;
+
+ $file = $this->addon->security->sanitize_filename($this->addon->uri->segment(5));
+
+ $this->addon->load->helper('file');
+
+ $mime = get_mime_by_extension($file);
+
+ //Is this even an image?
+
+ if( strpos($mime, 'image') === FALSE )
+ return FALSE;
+
+ header('Content-type: '.$mime);
+
+ $img_file = APPPATH.'third_party/helpme/views/themes/images/'.$file;
+
+ if ( file_exists($img_file) )
+ {
+ exit(file_get_contents($img_file));
+ }
+ }
+
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * Output a CSS file. Also just like that.
+ *
+ * @access private
+ * @return css
+ */
+ function _css()
+ {
+ // GoDaddy mode check
+
+ if( $this->addon->config->item('godaddy_mode') ):
+
+ $filename = str_replace('_', '.', $this->addon->uri->segment(5));
+
+ else:
+
+ $filename = $this->addon->uri->segment(5);
+
+ endif;
+
+ $file = $this->addon->security->sanitize_filename( $filename );
+
+ header("Content-Type: text/css");
+
+ echo file_get_contents( APPPATH . 'third_party/helpme/views/themes/css/'.$file);
+ }
+}
+
+/* End of file helpme.php */
+/* Location: system/mojomotor/third_party/helpme/libraries/helpme.php */
@@ -0,0 +1,55 @@
+<div class="clear">&nbsp; </div>
+
+<div id="helpme_sidebar">
+ <div class="helpme_sidebar_section">
+ <h3>Support Information</h3>
+
+ <ul>
+ <?php if($dev_name){ ?><li>Developer: <?=$dev_name?></li><?php } ?>
+ <?php if($support_email){ ?><li><a href="mailto:<?=$support_email?>">Email Support</a></li> <?php } ?>
+ <?php if($support_website){ ?><li><a href="<?=$support_website?>">Support Website</a></li><?php } ?>
+ </ul>
+ </div>
+
+ <div class="helpme_sidebar_section">
+ <h3>Additional Information</h3>
+ <p>HelpMe Version: <?=$helpme_version?><br />
+ <a href="http://mojomotor.com/">MojoMotor</a> <?=$this->lang->line('version').': '.$version?><br />
+ <?=$this->lang->line('language').': '.ucwords($this->config->item('language')); $language?></p>
+
+ <div id="mojo_copyright">
+ &copy;<?=date('Y')?> <a href="http://ellislab.com">EllisLab, Inc.</a></p>
+ </div>
+ </div>
+</div><!-- Close HelpMe Sidebar-->
+
+<div id="helpme_wrapper">
+
+ <!-- Your Code Here: -->
+
+ <h1>HelpMe Please!</h1>
+
+ <p>Hey Jason! Like I had mentioned, here are some instructions for you to know how to add the proper classes to your uploaded images and action buttons. Let me know if you need any other help! I hope you enjoy using MojoMotor :-)</p>
+
+ <h2>Available Image Classes</h2>
+
+ <p>You have two main options for styling the images on your pages. You can have them float either to the right or to the left. Once you've added the proper class, the image will also have a border applied to it.</p>
+
+ <p>This is how your image code will look right after you've uploaded it. (note: you must click on the "Source" button in the editor in order to view the code instead of the visual layout)</p>
+ <pre><code>&lt;img alt="driveway-garage-sample" src="http://zamoraservicesllc.com/mm_uploads/driveway-garage-sample.jpg" style="width: 250px; height: 167px; " /></code></pre>
+
+ <p>If you would like the image to float to the right, all you need to do is add the <span class="highlight">class="right"</span> to the code like this:</p>
+
+ <pre><code>&lt;img <span class="highlight">class="right"</span> alt="driveway-garage-sample" src="http://zamoraservicesllc.com/mm_uploads/driveway-garage-sample.jpg" style="width: 250px; height: 167px; " /></code></pre>
+
+ <p>Or, if you want it floated to the left side of the text:</p>
+
+ <pre><code>&lt;img <span class="highlight">class="left"</span> alt="driveway-garage-sample" src="http://zamoraservicesllc.com/mm_uploads/driveway-garage-sample.jpg" style="width: 250px; height: 167px; " /></code></pre>
+
+ <h2>Turning A Link Into A Button</h2>
+
+ <p>Similar to adding a class to an image, all you need to do to turn an ordaniry link into an action, or button, is add the <span class="highlight">class="action"</span> to it like follows:</p>
+
+ <pre><code>&lt;a <span class="highlight">class="action</span>" href="http://zamoraservicesllc.local/index.php/contact">Contact Us for a Free Estimate!&lt;/a></code></pre>
+
+</div>
Oops, something went wrong. Retry.

0 comments on commit c5f7018

Please sign in to comment.