Example #1
0
 public function portfolio()
 {
     if ($_FILES) {
         $config['upload_path'] = './assets/uploads/portfolio/';
         $config['allowed_types'] = 'gif|jpg|png';
         $config['max_size'] = '2024';
         $this->load->library('upload', $config);
         if (!$this->upload->do_upload('image')) {
             echo json_encode(array('error' => $this->upload->display_errors()));
         } else {
             $data = $this->upload->data();
             $this->global_m->insert('portfolio', array('user_id' => user_meta('id'), 'image' => $data['file_name'], 'description' => $_POST['description']));
             echo json_encode(array('img' => './assets/uploads/portfolio/' . $data['file_name'], 'des' => $_POST['description']));
         }
     } else {
         $data = $this->global_m->get('portfolio', 'user_id', user_meta('id'));
         $html = '';
         if (!empty($data)) {
             foreach ($data as $key => $value) {
                 $html .= '<a rel="prettyPhoto" href="' . assets_path('uploads/portfolio') . '/' . $value->image . '" class="preview">
                              <img alt="' . $value->description . '" src="' . assets_path('uploads/portfolio') . '/' . $value->image . '" width="230" style="padding-bottom: 5px">
                          </a>';
             }
         } else {
         }
         echo $html;
     }
 }
Example #2
0
File: admin.php Project: Moro3/duc
 function _get_tpl_admin()
 {
     $data['config'] = $this->config->item('site');
     $data['img_path'] = assets_path();
     $data['modules'] = $this->scheme->get_modules();
     $data['uri']['admin'] = $this->control_uri->get_full_segment(__CLASS__);
     $data['uri']['mod'] = $this->control_uri->get_segment(__CLASS__, 'mod');
     $date_menu['lang']['admin']['modules'] = $this->lang->line('admin_modules');
     //echo $data['uri']['mod'];
     return $data;
 }
Example #3
0
 private function generateURL($data)
 {
     for ($i = 0; $i < count($data); $i++) {
         if ($data[$i]['image_extension']) {
             $data[$i]['image'] = stripos(get_headers(assets_path('img/article/' . $data[$i]['id'] . '.' . $data[$i]['image_extension']))[0], "200 OK") ? assets_path('img/article/' . $data[$i]['id'] . '.' . $data[$i]['image_extension']) : FALSE;
         } else {
             $data[$i]['image'] = FALSE;
         }
         $data[$i]['link'] = site_url(date("Y", strtotime($data[$i]['datetime'])) . DS . date("m", strtotime($data[$i]['datetime'])) . DS . urlencode($data[$i]['title']));
     }
     return $data;
 }
Example #4
0
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->module_model(FUEL_FOLDER, 'users_model');
     $CI->load->module_library(BLOG_FOLDER, 'fuel_blog');
     $options = $CI->users_model->options_list();
     $upload_image_path = assets_server_path($CI->fuel_blog->settings('asset_upload_path'));
     $fields['fuel_user_id'] = array('label' => 'User', 'type' => 'select', 'options' => $options);
     // put all project images into a projects suboflder.
     $fields['avatar_image_upload']['upload_path'] = assets_server_path($CI->fuel_blog->settings('asset_upload_path'));
     // fix the preview by adding projects in front of the image path since we are saving it in a subfolder
     if (!empty($values['avatar_image'])) {
         $fields['avatar_image_upload']['before_html'] = '<img src="' . assets_path($CI->fuel_blog->settings('asset_upload_path') . $values['avatar_image']) . '" style="float: right;"/>';
     }
     return $fields;
 }
Example #5
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $name = explode("/", $this->argument('name'));
     if (count($name) > 1) {
         // If the array have more than 1 key/value
         $path = $name[0] . DIRECTORY_SEPARATOR . $name[1];
         if ($this->filesystem->exists($this->directory['vendor'] . DIRECTORY_SEPARATOR . $path)) {
             $this->filesystem->copyDirectory($this->directory['vendor'] . DIRECTORY_SEPARATOR . $path, assets_path('libraries' . DIRECTORY_SEPARATOR . $name[1]));
             $this->info('[' . $name[0] . '/' . $name[1] . '] is successfully imported into the assets libraries');
         } else {
             throw new \InvalidArgumentException('Sorry, we can not import because the path [' . $path . '] does not exists');
         }
     } else {
         // If the array only have 1 key/value
         $path = $name[0];
         if ($this->filesystem->exists($this->directory['vendor'] . DIRECTORY_SEPARATOR . $path)) {
             $this->filesystem->copyDirectory($this->directory['vendor'] . DIRECTORY_SEPARATOR . $path, assets_path('libraries' . DIRECTORY_SEPARATOR . $path));
             $this->info('[' . $path . '] is successfully imported into the assets libraries');
         } else {
             throw new \InvalidArgumentException('Sorry, we can not import because the path [' . $path . '] does not exists');
         }
     }
 }
Example #6
0
<img class="loading" src="<?php 
echo assets_path('images/loading.gif');
?>
" style="bottom: 0;left: 0;margin: auto;position: absolute;right: 0;top: 0;z-index: 9999; display:none" >
<div class="main-wrapper" style=" background-color: rgba(0, 0, 0, 0.6);">
    <div class="container">
        <h2>.</h2>
        <div class="media services-wrap wow fadeInDown animated" style=" padding-top:30px;visibility: visible; animation-name: fadeInDown;">
            <div class="col-md-12">
                <div class="col-md-9">
                <?php 
if ($this->session->flashdata('proposal_success')) {
    ?>
                    <div class="alert alert-<?php 
    echo $this->session->flashdata('class');
    ?>
 col-md-12"> <?php 
    echo $this->session->flashdata('proposal_success');
    ?>
</div>
               <?php 
}
?>
                <h1 style="color:#4e4e4e"><?php 
echo $job->title;
?>
</h1>
                </div>
                <div class="col-md-3">
                     <div class="col-md-7">
                        <strong>End In(Days)</strong>
Example #7
0
    ?>
                        <h3 id="send_proposal">Workstream With <?php 
    echo $userDtata->first_name;
    ?>
</h3>
                        <hr>
                        
                        <div class="col-md-12" id="workstream_thread" style="">
                            <?php 
    if (!empty($workstream)) {
        foreach ($workstream as $key => $value) {
            ?>
                                <div class="row">
                                    <div class="col-md-1">
                                        <img class="browse_job_user_img" style="margin-top: 33px;" src="<?php 
            echo assets_path('uploads/profile/' . $value->profile_image);
            ?>
">
                                    </div>
                                    <div class="col-md-11">
                                        <h6><?php 
            echo nice_date($value->time, 'd M Y');
            ?>
</h6>
                                         <p class="alert alert-success" id="othermsg" ><?php 
            echo $value->message;
            ?>
</p>
                                    </div>
                                </div>
                            <?php 
Example #8
0
 function fuelify($output)
 {
     // if not logged in then we remove the markers
     if (!$this->_CI->config->item('admin_enabled', 'fuel') or $this->variables('fuelified') === FALSE or !$this->_fuelified or empty($output) or defined('FUELIFY') and FUELIFY === FALSE) {
         return $this->remove_markers($output);
     }
     $this->_CI->load->library('session');
     // add top edit bar for fuel
     $this->_CI->config->module_load('fuel', 'fuel', TRUE);
     // render the markers to the proper html
     $output = $this->render_all_markers($output);
     // set main image and assets path before switching to fuel assets path
     $vars['init_params'] = array('assetsImgPath' => img_path(''), 'assetsPath' => assets_path(''));
     $this->_CI->asset->assets_path = $this->_CI->config->item('fuel_assets_path', 'fuel');
     $this->_CI->load->helper('ajax');
     $this->_CI->load->library('form');
     $vars['page'] = $this->properties();
     $vars['layouts'] = $this->_CI->fuel_layouts->layouts_list(TRUE);
     $editable_asset_types = $this->_CI->config->item('editable_asset_filetypes', 'fuel');
     // add javascript
     $vars['init_params']['pageId'] = !empty($vars['page']['id']) ? $vars['page']['id'] : 0;
     $vars['init_params']['basePath'] = WEB_PATH;
     $vars['init_params']['imgPath'] = img_path('', 'fuel');
     $vars['init_params']['cssPath'] = css_path('', 'fuel');
     $vars['init_params']['jsPath'] = js_path('', 'fuel');
     $vars['assetsAccept']['assetsAccept'] = !empty($editable_asset_types['media']) ? $editable_asset_types['media'] : 'jpg|gif|png';
     // database specific... so we must check the fuel mode to see if we actually need to make a call to the database.
     // otherwise we get an error when the mode is set to views
     if ($this->_CI->config->item('fuel_mode', 'fuel') == 'views') {
         $vars['others'] = array();
     } else {
         $this->_CI->load->module_model(FUEL_FOLDER, 'pages_model');
         $vars['others'] = $this->_CI->pages_model->get_others('location', $this->location, 'location');
     }
     if (!$this->_fuelified_processed) {
         $inline_edit_bar = $this->_CI->load->module_view(FUEL_FOLDER, '_blocks/inline_edit_bar', $vars, TRUE);
         $output = str_replace('</head>', css('fuel_inline', 'fuel') . "\n</head>", $output);
         $output = str_replace('</body>', $inline_edit_bar . "\n</body>", $output);
         $this->_CI->config->set_item('assets_path', $this->_CI->config->item('assets_path'));
     }
     $this->_fuelified_processed = TRUE;
     return $output;
 }
Example #9
0
 /**
  * Renders the inline editing markers before final output
  *
  * @access	public
  * @param	string	The output to be rendered
  * @return	string
  */
 public function fuelify($output)
 {
     // if not logged in then we remove the markers
     if (!$this->fuel->config('admin_enabled') or $this->variables('fuelified') === FALSE or !$this->_fuelified or empty($output) or defined('FUELIFY') and FUELIFY === FALSE) {
         return $this->remove_markers($output);
     }
     $this->CI->load->helper('convert');
     // add top edit bar for fuel
     $this->CI->config->module_load('fuel', 'fuel', TRUE);
     // render the markers to the proper html
     $output = $this->render_all_markers($output);
     // set main image and assets path before switching to fuel assets path
     $vars['init_params'] = array('assetsImgPath' => img_path(''), 'assetsPath' => assets_path(''));
     $orig_asset_path = $this->CI->asset->assets_path;
     $this->CI->asset->assets_path = $this->fuel->config('fuel_assets_path');
     $this->CI->load->helper('ajax');
     $this->CI->load->library('form');
     $last_page = uri_path();
     if (empty($last_page)) {
         $last_page = $this->fuel->config('default_home_view');
     }
     $vars['last_page'] = uri_safe_encode($last_page);
     if (!$this->_fuelified_processed) {
         // create the inline edit toolbar
         $inline_edit_bar = $this->fuel->admin->toolbar();
         $fuel_js_obj = "<script>if (typeof fuel == 'undefined') fuel = {}</script>\n";
         $inline_css = css('fuel_inline', 'fuel', array('output' => $this->fuel->config('fuel_assets_output')));
         $output = preg_replace('#(</head>)#i', $fuel_js_obj . $inline_css . "\n\$1", $output);
         $output = preg_replace('#(</body>)#i', $inline_edit_bar . "\n\$1", $output);
         $this->CI->config->set_item('assets_path', $this->CI->config->item('assets_path'));
     }
     $this->_fuelified_processed = TRUE;
     $this->CI->asset->assets_path = $orig_asset_path;
     return $output;
 }
Example #10
0
                                            <img src="<?php 
        echo $image_path;
        ?>
"  width="20" style="border-radius: 50%; margin: 2px 4px 0 -10px; float: left">
                                            <h3 class="panel-title" style="margin:0; float: left"><?php 
        echo $value->first_name;
        ?>
</h3>
                                            <h3 class="pull-right" style="margin:0; ">$<?php 
        echo $value->price;
        ?>
</h3>
                                        </div>
                                        <div class="panel-body">
                                            <img class="responsive" height="160" style="width: 100%" src="<?php 
        echo assets_path('/uploads/hourlies/' . $value->media);
        ?>
" width="197">
                                             <P style="margin-top:5px; min-height: 44px">
                                                 <?php 
        echo character_limiter($value->description, 40);
        ?>
                                             </P>
                                        </div>
                                    </div>
                                </div>
                            <?php 
    }
    ?>
                            <?php 
}
Example #11
0
        }
        ?>
 </span>
                                    </div>
                                    <div class="col-md-6">
                                        <span class=" job_price" >$<?php 
        echo $value->rate;
        ?>
</span>
                                    </div>
                                </div>
                                <div class="col-md-12" style="padding-top: 20px  ">
                                    <div class="col-md-3">
                                        <div class="col-md-3" style="padding-left: 0">
                                            <?php 
        $image_path = !empty($value->profile_image) ? assets_path('uploads/profile/' . $value->profile_image) : assets_path('images/default_profile.jpg');
        ?>
                                            <img src="<?php 
        echo $image_path;
        ?>
" class="browse_job_user_img">
                                        </div>
                                        <div class="col-md-9">
                                            <p style="margin-bottom:0; margin-left: 10px"><?php 
        echo $value->first_name;
        ?>
 </p>
                                            <p style="margin-left: 10px"><strong><?php 
        $addressArray = explode(',', $value->address);
        echo end($addressArray);
        ?>
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->publishes([__DIR__ . '/config/form.php' => config_path('form.php'), __DIR__ . '/assets' => assets_path('regulus/formation')]);
     $this->loadTranslationsFrom(__DIR__ . '/lang', 'formation');
     $this->loadViewsFrom(__DIR__ . '/views', 'formation');
 }
Example #13
0
<h4><strong>These are the steps in the following tutorial:</strong></h4>
<ol>
  <li><a href="#setup">Download and Setup</a></li>
  <li><a href="#authors_module">The Authors Module</a></li>
  <li><a href="#articles_module">The Articles Module</a></li>
  <li><a href="#categories_module">The FUEL Tags Module</a></li>
  <li><a href="#permissions">Setting Up Permissions</a></li>
  <li><a href="#polishing">A Little Polishing</a></li>
  <li><a href="#views">Bringing it All Into View</a></li>
</ol>

<h2 id="setup">Download and Setup</h2>

<p>Before we get started with this tutorial, it is recommended that you <a href="<?php 
echo assets_path('fuel_modules_example.zip', 'docs', FUEL_FOLDER);
?>
"><strong>download the final files of the example</strong></a> and look them over briefly so it is easier to follow along.</p>

<p>You will need to <a href="<?php 
echo user_guide_url('installation/db-setup');
?>
">setup an instance of FUEL including the database</a> with a working admin login.
We will use that FUEL database to store the additional tables required for our models in this tutorial.</p>

<p>We will be creating two database tables to support the 2 modules &mdash; an authors table and an articles table. The fuel_tags table is already created for us.</p>


<h2 id="authors_module">The Authors Module</h2>
<p>We will start this tutorial by creating the authors module first. The authors module will be used to contain the list of article's authors.</p>
<p>In many cases, to get started creating a simple module, you will want to use the <a href="<?php 
<?php

defined('BASEPATH') or exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Omah Bocah</title>
  <link rel="shortcut icon" href="<?php 
echo assets_path('img/favicon.ico');
?>
">
  <link id="basePath" href="<?php 
echo site_url();
?>
" />
  <?php 
echo assets_js('angular/angular.min.js');
?>
  <?php 
echo assets_js('angular/angular-route.min.js');
?>
  <?php 
echo assets_js('jquery.min.js');
?>
  <?php 
echo assets_js('bootstrap.min.js');
?>
  <?php 
echo assets_js('date.js');
    /**
     * Creates an asset select/upload field
     *
     * @access	public
     * @param	array Fields parameters
     * @return	string
     */
    public function asset($params)
    {
        $this->CI->load->helper('file');
        $this->CI->load->helper('html');
        $form_builder =& $params['instance'];
        if (empty($params['folder'])) {
            $params['folder'] = 'images';
        }
        $asset_class = '';
        if (!isset($params['select']) or isset($params['select']) and $params['select'] !== FALSE) {
            $asset_class .= ' asset_select';
        }
        if (!isset($params['upload']) or isset($params['upload']) and $params['upload'] !== FALSE) {
            $asset_class .= ' asset_upload';
        }
        $asset_class .= ' ' . $params['folder'];
        $params['class'] = !empty($params['class']) ? $params['class'] . ' ' . $asset_class : $asset_class;
        // set the image preview containing class
        if (empty($params['img_container_styles'])) {
            $params['img_container_styles'] = 'overflow: auto; height: 200px; width: 400px; margin-top: 5px;';
        }
        // set the styles specific to the image
        if (!isset($params['img_styles'])) {
            $params['img_styles'] = 'float: left; width: 100px;';
        }
        // folders and intended contents
        $editable_filetypes = $this->fuel->config('editable_asset_filetypes');
        // set data parameters so that we can use them with the JS
        // set multiple and separator data attributes so can be used by javascript
        if (!isset($params['multiple'])) {
            $multiple = !empty($params['multiple']) or strpos($params['value'], ',') !== FALSE;
        } else {
            $multiple = $params['multiple'];
        }
        // set the separator based on if it is multiple lines or just a single line
        $separator = (isset($params['multiline']) and $params['multiline'] === TRUE) ? "\n" : ', ';
        $params['data'] = array('multiple' => $multiple, 'separator' => $separator, 'folder' => $params['folder']);
        if (!empty($params['value'])) {
            if (is_string($params['value'])) {
                // unserialize if it is a serialized string
                if (is_json_str($params['value'])) {
                    $assets = json_decode($params['value'], TRUE);
                    //$assets = unserialize($params['value']);
                } else {
                    if ($multiple) {
                        // create assoc array with key being the image and the value being either the image name again or the caption
                        $assets = preg_split('#\\s*,\\s*|\\n#', $params['value']);
                    } else {
                        $assets = array($params['value']);
                    }
                }
                $preview_str = '';
                // loop through all the assets and concatenate them
                foreach ($assets as $asset) {
                    if (!empty($asset)) {
                        $asset_path = '';
                        foreach ($editable_filetypes as $folder => $regex) {
                            if (!is_http_path($asset)) {
                                if (preg_match('#' . $regex . '#i', $asset)) {
                                    $path = trim($params['folder'], '/') . '/' . $asset;
                                    $asset_path = assets_path($path);
                                    break;
                                }
                            } else {
                                $asset_path = $asset;
                            }
                        }
                        if (!empty($asset_path)) {
                            $preview_str .= '<a href="' . $asset_path . '" target="_blank">';
                            if (isset($params['is_image']) or !isset($params['is_image']) and is_image_file($asset)) {
                                $preview_str .= '<img src="' . $asset_path . '" style="' . $params['img_styles'] . '"/>';
                            } else {
                                $preview_str .= $asset;
                            }
                            $preview_str .= '</a>';
                        }
                    }
                }
            }
            $preview = '';
            if (!empty($preview_str)) {
                $img_container_styles = $params['img_container_styles'];
                if ($multiple == FALSE and !empty($params['img_styles'])) {
                    $img_container_styles = $params['img_styles'];
                }
                $preview = '<br /><div class="noclone" style="' . $img_container_styles . '">';
                $preview .= $preview_str;
                $preview .= '</div><div class="clear"></div>';
            }
            $params['after_html'] = $preview;
        }
        $params['type'] = '';
        if ($multiple) {
            $process_key = isset($params['subkey']) ? $params['subkey'] : $params['key'];
            // create an array with the key being the image name and the value being the caption (if it exists... otherwise the image name is used again)
            $func_str = '
				if (is_array($value))
				{
					foreach($value as $key => $val)
					{
						if (isset($val["' . $process_key . '"]))
						{
							if (is_string($val["' . $process_key . '"]))
							{
								$z = $val["' . $process_key . '"];
							}
							else if (is_array($val["' . $process_key . '"]) AND isset($val["' . $process_key . '"]["' . $params['name'] . '"]))
							{
								$z = $val["' . $process_key . '"]["' . $params['name'] . '"];
							}
							$z = trim($z);
							$assets = array();
							$assets_arr = preg_split("#\\s*,\\s*|\\n#", $z);

							if (is_string($val["' . $process_key . '"]))
							{
								if (count($assets_arr) > 1)
								{
									$value[$key]["' . $process_key . '"] = json_encode($assets_arr);
								}
								else
								{
									$value[$key]["' . $process_key . '"] = $z;
								}
							}
							else if (is_array($val["' . $process_key . '"]) AND isset($val["' . $process_key . '"]["' . $params['name'] . '"]))
							{
								if (count($assets_arr) > 1)
								{
									$value[$key]["' . $process_key . '"]["' . $params['name'] . '"] = json_encode($assets_arr);
								}
								else
								{
									$value[$key]["' . $process_key . '"]["' . $params['name'] . '"] = $z;
								}
							}
							
						}
					}
					return $value;
				}
				else
				{
					$value = trim($value);
					$assets_arr = preg_split("#\\s*,\\s*|\\n#", $value);
					if (count($assets_arr) > 1)
					{
						return json_encode($assets_arr);
					}
					else
					{
						return $value;
					}
				}
				';
            $func = create_function('$value', $func_str);
            $form_builder->set_post_process($params['key'], $func);
        }
        // unserialize value if it's serialized
        //$value = (is_serialized_str($params['value'])) ? unserialize($params['value']) : $params['value'];
        $value = (is_string($params['value']) and is_json_str($params['value'])) ? json_decode($params['value'], TRUE) : $params['value'];
        if (is_array($value)) {
            $params['value'] = '';
            foreach ($value as $key => $val) {
                if (!empty($val)) {
                    $params['value'] .= $val . $separator;
                }
            }
        }
        $params['value'] = trim($params['value'], ",\n ");
        //$params['comment'] = 'Add a caption value to your image by inserting a colon after the image name and then enter your caption like so: my_img.jpg:My caption goes here.';
        // data params
        $data_params['asset_folder'] = $params['folder'];
        $data_params['subfolder'] = isset($params['subfolder']) ? $params['subfolder'] : '';
        $data_params['userfile_file_name'] = isset($params['file_name']) ? $params['file_name'] : '';
        $data_params['overwrite'] = isset($params['overwrite']) ? (bool) $params['overwrite'] : TRUE;
        $data_params['unzip'] = isset($params['unzip']) ? (bool) $params['unzip'] : TRUE;
        $data_params['create_thumb'] = isset($params['create_thumb']) ? (bool) $params['create_thumb'] : FALSE;
        $data_params['maintain_ratio'] = isset($params['maintain_ratio']) ? (bool) $params['maintain_ratio'] : FALSE;
        $data_params['width'] = isset($params['width']) ? (int) $params['width'] : '';
        $data_params['height'] = isset($params['height']) ? (int) $params['height'] : '';
        $data_params['master_dim'] = isset($params['master_dim']) ? $params['master_dim'] : '';
        $data_params['resize_and_crop'] = isset($params['resize_and_crop']) ? $params['resize_and_crop'] : '';
        $data_params['resize_method'] = isset($params['resize_method']) ? $params['resize_method'] : 'maintain_ratio';
        $data_params['hide_options'] = isset($params['hide_options']) ? (bool) $params['hide_options'] : FALSE;
        $data_params['accept'] = isset($params['accept']) ? $params['accept'] : '';
        if (isset($params['hide_image_options'])) {
            $data_params['hide_image_options'] = isset($params['hide_image_options']) ? (bool) $params['hide_image_options'] : FALSE;
        } else {
            if (!isset($params['hide_image_options']) and !preg_match('#^images#', $params['folder'])) {
                $data_params['hide_image_options'] = TRUE;
            }
        }
        $params['data']['params'] = http_build_query($data_params);
        if (!empty($params['multiline'])) {
            $params['class'] = 'no_editor ' . $params['class'];
            if (empty($params['style'])) {
                $params['style'] = 'float: left; width: 400px; height: 60px';
            }
            $str = $form_builder->create_textarea($params);
        } else {
            $str = $form_builder->create_text($params);
        }
        $str .= $params['after_html'];
        return $str;
    }
Example #16
0
	function fuelify($output)
	{
		// if not logged in then we remove the markers
		if (!$this->_CI->config->item('admin_enabled', 'fuel') OR $this->variables('fuelified') === FALSE OR 
			!$this->_fuelified OR empty($output) OR (defined('FUELIFY') AND FUELIFY === FALSE)) 
		{
			return $this->remove_markers($output);
		} 
		
		$this->_CI->load->library('session');
		$this->_CI->load->helper('convert');
		
		
		// add top edit bar for fuel
		$this->_CI->config->module_load('fuel', 'fuel', TRUE);
		
		// render the markers to the proper html
		$output = $this->render_all_markers($output);
		
		// set main image and assets path before switching to fuel assets path
		$vars['init_params'] = array(
			'assetsImgPath' => img_path(''),
			'assetsPath' => assets_path(''),
			);
		
		$this->_CI->asset->assets_path = $this->_CI->config->item('fuel_assets_path', 'fuel');
		$this->_CI->load->helper('ajax');
		$this->_CI->load->library('form');
		$vars['page'] = $this->properties();
		$vars['layouts'] = $this->_CI->fuel_layouts->layouts_list(TRUE);
		$last_page = uri_path();
		if (empty($last_page)) $last_page = $this->_CI->config->item('default_home_view', 'fuel');
		$vars['last_page'] = uri_safe_encode($last_page);

		$editable_asset_types = $this->_CI->config->item('editable_asset_filetypes', 'fuel');


		// add javascript
		$vars['init_params']['pageId'] = (!empty($vars['page']['id']) ? $vars['page']['id'] : 0);
		$vars['init_params']['basePath'] = WEB_PATH;
		$vars['init_params']['imgPath'] = img_path('', 'fuel'); 
		$vars['init_params']['cssPath'] = css_path('', 'fuel'); 
		$vars['init_params']['jsPath'] = js_path('', 'fuel');
		$vars['init_params']['editor'] = $this->_CI->config->item('text_editor', 'fuel');
		$vars['init_params']['editorConfig'] = $this->_CI->config->item('ck_editor_settings', 'fuel');
		
		// load language files
		$this->_CI->load->module_language(FUEL_FOLDER, 'fuel_inline_edit');
		$this->_CI->load->module_language(FUEL_FOLDER, 'fuel_js');
		
		
		// json localization
		$vars['js_localized'] = json_lang('fuel/fuel_js');
		$vars['assetsAccept']['assetsAccept'] = (!empty($editable_asset_types['media']) ? $editable_asset_types['media'] : 'jpg|gif|png');
		
		// database specific... so we must check the fuel mode to see if we actually need to make a call to the database. 
		// otherwise we get an error when the mode is set to views
		if ($this->_CI->config->item('fuel_mode', 'fuel') == 'views')
		{
			$vars['others'] = array();
		}
		else
		{
			$this->_CI->load->module_model(FUEL_FOLDER, 'pages_model');
			$vars['others'] = $this->_CI->pages_model->get_others('location', $this->location, 'location');
		}
		
		if (!$this->_fuelified_processed)
		{
			$inline_edit_bar = $this->_CI->load->module_view(FUEL_FOLDER, '_blocks/inline_edit_bar', $vars, TRUE);
			$output = preg_replace('#(</head>)#i', css('fuel_inline', 'fuel')."\n$1", $output);
			$output = preg_replace('#(</body>)#i', $inline_edit_bar."\n$1", $output);
			$this->_CI->config->set_item('assets_path', $this->_CI->config->item('assets_path'));
		}
		$this->_fuelified_processed = TRUE;
		return $output;
	}
Example #17
0
 function get_image_path($type = 'main')
 {
     $CI =& get_instance();
     $img = $this->get_image($type);
     $path = $CI->fuel->blog->config('asset_upload_path') . $img;
     return assets_path($path);
 }
Example #18
0
 /**
  * Creates a file upload field but has the option to allow multiple fields
  *
  * @access	public
  * @param	array Fields parameters
  * @return	string
  */
 public function file($params)
 {
     $this->CI->load->helper('file');
     $form_builder =& $params['instance'];
     $file_params = $params;
     if (!empty($params['multiple'])) {
         $file_params['class'] = 'multifile ' . $params['class'];
     }
     $file_params['name'] = str_replace(array('[', ']', '__'), array('_', '', '_'), $params['name']);
     $file_params['id'] = $file_params['name'] . '_upload';
     $str = '';
     $preview = '';
     $asset_folder = '';
     if (!isset($params['display_preview']) or $params['display_preview'] === TRUE) {
         // set the image preview containing class
         if (empty($params['img_container_styles'])) {
             $params['img_container_styles'] = 'overflow: auto; height: 200px; width: 400px; margin-top: 5px;';
         }
         // set the styles specific to the image
         if (!isset($params['img_styles'])) {
             $params['img_styles'] = 'float: left; width: 100px;';
         }
         if (empty($params['value'])) {
             $params['value'] = '';
         }
         if (isset($params['folder']) or isset($params['upload_path'])) {
             if (isset($params['folder'])) {
                 $asset_folder = trim($params['folder'], '/') . '/';
                 $asset_path = $asset_folder . $params['value'];
                 $asset_path = assets_path($asset_path);
             } else {
                 $asset_folder = assets_server_to_web_path($params['upload_path']) . '/';
                 $asset_path = $asset_folder . $params['value'];
             }
             if (!empty($params['replace_values'])) {
                 foreach ($params['replace_values'] as $key => $val) {
                     if (is_string($val)) {
                         $asset_path = str_replace('{' . $key . '}', $val, $asset_path);
                         $asset_folder = str_replace('{' . $key . '}', $val, $asset_folder);
                     }
                 }
             }
         }
         $preview = '';
         if (!empty($asset_path) and !empty($params['value'])) {
             $preview .= ' ';
             $preview .= '<div class="asset_upload_preview deletable noclone"><a href="#' . $params['key'] . '" class="asset_delete"></a><a href="' . $asset_path . '" target="_blank">';
             if (isset($params['is_image']) or !isset($params['is_image']) and is_image_file($asset_path)) {
                 $preview .= '<br><img src="' . $asset_path . '" style="' . $params['img_styles'] . '" class="img_bg">';
             } else {
                 $preview .= $asset_path;
             }
             $preview .= '</a>';
         }
     }
     $params['after_html'] = $preview;
     $str .= $form_builder->create_file($file_params);
     if (!empty($params['display_input'])) {
         $params['data'] = array('folder' => $asset_folder);
         $asset_class = '';
         if (!isset($params['select']) or isset($params['select']) and $params['select'] !== FALSE) {
             $asset_class = 'asset_select';
         }
         $params['class'] = !empty($params['class']) ? $params['class'] . ' ' . $asset_class : $asset_class;
         $params['type'] = '';
         $str .= '<br><br>' . $form_builder->create_field($params);
     } else {
         $params['type'] = 'hidden';
         $str .= $form_builder->create_field($params);
     }
     // add image altering hidden field values
     $additional_params = array('create_thumb', 'thumb_marker', 'maintain_ratio', 'master_dim', 'width', 'height', 'resize_and_crop', 'remove_spaces', 'resize_method');
     foreach ($additional_params as $p) {
         if (isset($params[$p])) {
             $str .= $this->CI->form->hidden($file_params['name'] . '_' . $p, $params[$p], 'class="noclear"');
         }
     }
     return $str;
 }
 function get_avatar_img_tag($attrs = array())
 {
     $CI =& get_instance();
     $CI->load->module_library(BLOG_FOLDER, 'fuel_blog');
     $CI->load->helper('html');
     $image_path = $CI->fuel_blog->settings('asset_upload_path');
     $src = assets_path($image_path . $this->avatar_image);
     $attrs = html_attrs($attrs);
     if (!empty($this->avatar_image)) {
         return '<img src="' . $src . '"' . $attrs . ' />';
     }
     return '';
 }
Example #20
0
 /**
  * Displays the most recently uplloaded 
  *
  * @access	public
  * @param	array View variable data (optional)
  * @return	mixed Can be an array of items or a string value
  */
 public function related_items($params)
 {
     $CI =& get_instance();
     $uploaded_post = $CI->session->flashdata('uploaded_post');
     if (!empty($uploaded_post['uploaded_file_webpath'])) {
         $img = '';
         foreach ($uploaded_post['uploaded_file_webpath'] as $uploaded_image) {
             if (is_image_file($uploaded_image)) {
                 $img .= '<a href="' . assets_path($uploaded_image) . '" target="_blank"><img src="' . assets_path($uploaded_image) . '?c=' . time() . '" alt="" style="max-width: 100%;" /></a>';
             }
         }
         return $img;
     }
     return '';
 }
?>
" /></a></div>
                        </figure>
                        <p>1: Großübung der Jugendfeuerwehr</p>
                    </li>
                    <li id="slideshow_jfw_2" class="noActive">
                        <figure>
                        	<img src="<?php 
echo img_path('nachwuchs/jf_großuebung04.jpg');
?>
" alt="Großübung der Jugendfeuerwehr" />
                        	<div class="zoom"><a href="<?php 
echo img_path('nachwuchs/jf_großuebung04.jpg');
?>
" class="fancybox-gallery" rel="gallery1"><img src="<?php 
echo assets_path('button_zoom.png', 'layout');
?>
" /></a></div>
                        </figure>
                        <p>2: Großübung der Jugendfeuerwehr</p>
                    </li>
                    <li id="slideshow_jfw_3" class="noActive">
                        <figure>
                        	<img src="<?php 
echo img_path('nachwuchs/jf_großuebung05.jpg');
?>
" alt="Großübung der Jugendfeuerwehr" />
                        	<div class="zoom"><a href="<?php 
echo img_path('nachwuchs/jf_großuebung05.jpg');
?>
" class="fancybox-gallery" rel="gallery1"><img src="<?php 
Example #22
0
 /**
  * Returns an image based on the assets upload path
  *
  * @access	public
  * @param	string
  * @param	string
  * @param	boolean
  * @return	string
  */
 function image_path($image, $variable = NULL, $is_server = FALSE)
 {
     $base_path = $this->fuel->blog->config('asset_upload_path');
     $base_path = preg_replace('#(\\{.+\\})#U', $variable, $base_path);
     if ($is_server) {
         $folder = assets_server_path($base_path);
     } else {
         $folder = assets_path($base_path);
     }
     return $folder . $image;
 }
 function get_avatar_image_path()
 {
     $path = $this->_CI->fuel->blog->config('asset_upload_path') . $this->avatar_image;
     return assets_path($path);
 }
Example #24
0
}
?>
        <nav class="navbar navbar-inverse" style="z-index:1">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="<?php 
echo base_url('');
?>
"><img src="<?php 
echo assets_path();
?>
/images/logo1.png" alt="logo"></a>
                </div>
				
                <div class="collapse navbar-collapse navbar-right">
                    <ul class="nav navbar-nav">
                        <li><a href="<?php 
echo base_url('buy');
?>
">BUY</a></li>
                        <li><a href="<?php 
echo base_url('job/browse');
?>
">SELL</a></li>
                        <li><a href="<?php 
";
jqx_config.jsPath = "<?php 
echo js_path('', 'fuel');
?>
";
jqx_config.imgPath = "<?php 
echo img_path('', 'fuel');
?>
";

jqx_config.assetsImgPath = "<?php 
echo img_path('');
?>
";
jqx_config.assetsPath = "<?php 
echo assets_path('');
?>
";

jqx_config.jqxPath = jqx_config.jsPath + "jqx/";
jqx_config.controllerPath = <?php 
echo $this->js_controller_path;
?>
;
jqx_config.pluginPath = jqx_config.jsPath + "jquery/";
jqx_config.helpersPath = jqx_config.jqxPath + 'helpers/';
jqx_config.pluginPath = jqx_config.jsPath + 'jquery/plugins/';
jqx_config.fuelPath = '<?php 
echo site_url($this->config->item('fuel_path', 'fuel'));
?>
';
Example #26
0
 public function search_job()
 {
     $title = $this->input->post('title');
     if (!empty($title)) {
     }
     $result = $this->Job_m->search_job($title);
     if (!empty($result)) {
         $html = '';
         foreach ($result as $key => $value) {
             $addressArray = explode(",", $value->address);
             $type = $value->type == 'fixed_type' ? 'FIXED PRICE' : 'PER HOUR';
             if ($value->level == 1) {
                 $level = "\$";
             } elseif ($value->level == 2) {
                 $level = '$$';
             } else {
                 $level = "\$\$\$";
             }
             $image_path = !empty($value->profile_image) ? assets_path("uploads/profile/" . $value->profile_image) : assets_path("images/default_profile.jpg");
             $html .= '<div class="col-md-12 single_job">   
                             <div class="col-md-12">
                                 <div class="col-md-10"><a href="detail/' . $value->slug . '" class="job_title">' . $value->title . '</a></div>
                                 <div class="col-md-2 ">
                                     <span class="">' . $type . '</span>
                                 </div>
                             </div>
                             <div class="col-md-12">
                                 <div class="col-md-6" style="">
                                     <span class=" job_exp" >' . $level . '</span>
                                 </div>
                                 <div class="col-md-6">
                                     <span class=" job_price" >$' . $value->rate . '</span>
                                 </div>
                             </div>
                             <div class="col-md-12" style="padding-top: 20px  ">
                                 <div class="col-md-3">
                                     <div class="col-md-3">
                                         <img src="' . $image_path . '" class="browse_job_user_img">
                                     </div>
                                     <div class="col-md-9">
                                         <p style="margin-bottom:0; margin-left: 10px">' . $value->first_name . '</p>
                                         <p style="margin-left: 10px"><strong>' . end($addressArray) . '</strong></p>
                                     </div>
                                 </div>
                                 <div class="col-md-3"><p class="browse-p">Posted ' . timespan(human_to_unix($value->created_at), time(), 1) . " ago" . '</p></div>
                                 <div class="col-md-2"><p class="browse-p">Proposals 2</p></div>
                                 <div class="col-md-4"><p class="browse-a"><a href="detail/' . $value->slug . '" class="bnt btn-lg btn-primary btn-proposal "> SEND PROPOSAL </a></p></div>
                             </div>
                         </div>';
             $total_jobs = count($result);
         }
     } else {
         $total_jobs = 0;
         $html = "<h1>no job found</h1>";
     }
     $result_array = array('html' => $html, 'total_jobs' => $total_jobs);
     echo json_encode($result_array);
 }