/** * sidebar function * Create sidebar * @return string * @author joharijumali **/ public static function sidebar() { // $Menu = Header::navigationdata(); $flow = URI::segment(3) == 'step' ? true : false; $navValue = array(array(Navigation::HEADER, Str::upper(Lang::line('admin.monitor')->get())), array(Lang::line('admin.dashboard')->get(), url('admin/home/dashboard'), false, false, null, 'tasks'), array(Navigation::HEADER, Str::upper(Lang::line('admin.sysmgmt')->get())), array(Lang::line('admin.configmanagement')->get(), url('admin/system/sysConfig'), false, false, null, 'chevron-right'), array(Lang::line('admin.datamanagement')->get(), url('admin/data/board'), false, false, null, 'chevron-right'), array(Lang::line('admin.pagemanagement')->get(), url('admin/modul/page'), false, false, null, 'chevron-right'), array(Lang::line('admin.flowmanagement')->get(), url('admin/modul/flow'), $flow, false, null, 'chevron-right'), array(Lang::line('admin.navsetup')->get(), url('admin/system/navigate'), false, false, null, 'chevron-right'), array(Lang::line('admin.log')->get(), url('admin/system/logger'), false, false, null, 'chevron-right'), array(Navigation::HEADER, Str::upper(Lang::line('admin.sysuser')->get())), array(Lang::line('admin.navuserlist')->get(), url('admin/user/list'), false, false, null, 'chevron-right'), array(Lang::line('admin.navuserrole')->get(), url('admin/user/role'), false, false, null, 'chevron-right'), array(Navigation::HEADER, Lang::line('global.logout')->get()), array(Lang::line('global.logout')->get(), url('admin/login/logout'), false, false, null, 'off')); return Navigation::lists(Navigation::links($navValue)); }
/** * Get a language specific line * * @param string $key The Key to search * @param array $subst array The values to substitute * @param string $lang string The language * * @return string */ public function t($key, $subst = null, $lang = null) { if (is_null($lang)) { $lang = Config::get('application.language', 'en_US'); } if (is_null($subst)) { return Lang::line($key, array())->get($lang); } else { parse_str($subst, $repl); return Lang::line($key, $repl)->get($lang); } }
public static function listData() { $allGroup = Group::paginate(Config::get('system.pagination')); $datagrid = new Datagrid(); $datagrid->setFields(array('group_name' => Str::upper(Lang::line('admin.datagroup')->get()))); $datagrid->setAction(Lang::line('global.manage')->get(), 'datacontent', false); $datagrid->setAction(Lang::line('global.edit')->get(), 'editGroup', true, array('dmid')); $datagrid->setAction(Lang::line('global.delete')->get(), 'deleteGroup', true, array('dmid', 'group_name')); $datagrid->setTable('dataGroup', 'table table-bordered table-hover table-striped table-condensed'); $datagrid->build($allGroup, 'dmid'); return $datagrid->render(); }
public static function listRole() { $rolelist = Role::paginate(Config::get('system.pagination')); $datagrid = new Datagrid(); $datagrid->setFields(array('role' => Str::upper(Lang::line('admin.rolename')->get()), 'roledesc' => Str::upper(Lang::line('admin.roledesc')->get()))); $datagrid->setAction(Lang::line('global.edit')->get(), 'editRoleModal', true, array('roleid')); //false,array('id'=>'roleid','data-toggle'=>'modal')); $datagrid->setAction(Lang::line('global.delete')->get(), 'deleteRole', true, array('roleid')); $datagrid->setContainer('list01', 'span12'); $datagrid->setTable('users', 'table table-bordered table-hover table-striped table-condensed'); $datagrid->build($rolelist, 'roleid'); return $datagrid->render(); }
public static function userSearchList($input) { $operator = stripos($input['searchval'], '*') ? 'LIKE' : '='; $val = str_replace("*", "", $input['searchval']); $refval = stripos($input['searchval'], '*') ? '%' . $val . '%' : $val; $allUser = User::left_join('users_profiles', 'users.userid', '=', 'users_profiles.userid')->where('icno', $operator, $refval)->or_where('fullname', $operator, $refval)->paginate(Config::get('system.pagination')); $datagrid = new Datagrid(); $datagrid->setFields(array('userprofile/fullname' => Str::upper(Str::title(Lang::line('admin.fullname')->get())))); $datagrid->setFields(array('userprofile/emel' => Str::upper(Str::title(Lang::line('admin.activeemel')->get())))); $datagrid->setFields(array('userprofile/icno' => Str::upper(Str::title(Lang::line('admin.idno')->get())))); $datagrid->setFields(array('status' => Str::upper('Status'))); $datagrid->setAction(Lang::line('global.edit')->get(), 'viewUser', true, array('userid')); $datagrid->setAction(Lang::line('global.delete')->get(), 'deleteAccount', true, array('userid')); $datagrid->setAction(Lang::line('global.reset')->get(), 'resetAccount', true, array('userid')); $datagrid->setTable('users', 'table table-bordered table-hover table-striped table-condensed'); $datagrid->build($allUser, 'userid'); return $datagrid->render(); }
public static function upload($zip_file) { $zip = new \ZipArchive(); $res = $zip->open($zip_file['tmp_name']); if ($res === TRUE) { $module_name_parts = explode('.', $zip_file['name']); if (is_array($module_name_parts) and count($module_name_parts) > 0) { $module_slug = $module_name_parts['0']; // Check if bundle folder exists if (is_dir(path('bundle') . $module_slug)) { static::$errors->add('installer', Lang::line('modules::lang.The folder ":module_slug" already exists', array('module_slug' => $module_slug))->get(ADM_LANG)); $zip->close(); return false; } // Check if zip file contain // an valid module info file if (is_array($module_name_parts) and count($module_name_parts) > 0) { $tmp = tmpfile(); $module_info = stream_get_meta_data($tmp); file_put_contents($module_info['uri'], $zip->getFromName(strtolower($module_name_parts['0']) . DS . 'info.json')); if (!Module::check_info_file($module_info['uri'])) { static::$errors->add('installer', Lang::line('modules::lang.The zip file does not contain a valid module info file')->get(ADM_LANG)); $zip->close(); return false; } } $zip->extractTo(path('bundle')); $zip->close(); return true; } else { static::$errors->add('installer', 'Invalid module slug'); $zip->close(); return false; } } else { static::$errors->add('installer', 'Failed to uncompress the module zip file.'); return false; } }
/** * Generate Data datagrid table * * @return void * @author **/ public static function genListData() { $allContent = Content::paginate(Config::get('system.pagination')); $datagrid = new Datagrid(); $tableCol = DB::query('show columns from ' . Content::$table); foreach ($tableCol as $value) { if ($value->field != 'created_at' && $value->field != 'updated_at' && $value->field != Content::$key) { if (stristr($value->field, 'name')) { $title = Str::upper(Lang::line('global.data')->get()); } elseif (stristr($value->field, 'desc')) { $title = Str::upper(Lang::line('global.desc')->get()); } else { $title = $value->field; } $datagrid->setFields(array($value->field => $title)); } } $datagrid->setAction(Lang::line('global.edit')->get(), 'editData', true, array(Content::$key)); $datagrid->setAction(Lang::line('global.delete')->get(), 'deleteData', true, array(Content::$key)); $datagrid->setTable('contentGroup', 'table table-bordered table-hover table-striped table-condensed'); $datagrid->build($allContent, Content::$key); return $datagrid->render(); }
/** * Get the displayable name for a given attribute. * * @param string $attribute * @return string */ protected function attribute($attribute) { $bundle = Bundle::prefix($this->bundle); // More reader friendly versions of the attribute names may be stored // in the validation language file, allowing a more readable version // of the attribute name to be used in the message. // // If no language line has been specified for the attribute, all of // the underscores will be removed from the attribute name and that // will be used as the attribtue name. $line = "{$bundle}validation.attributes.{$attribute}"; $display = Lang::line($line)->get($this->language); return is_null($display) ? str_replace('_', ' ', $attribute) : $display; }
/** * Get the displayable name for a given attribute. * * @param string $attribute * @return string */ protected function attribute($attribute) { $bundle = Bundle::prefix($this->bundle); // More reader friendly versions of the attribute names may be stored // in the validation language file, allowing a more readable version // of the attribute name in the message. $line = "{$bundle}validation.attributes.{$attribute}"; if (Lang::has($line, $this->language)) { return Lang::line($line)->get($this->language); } else { return str_replace('_', ' ', $attribute); } }
/** * Get the displayable name for a given attribute. * * Storing attribute names in the language file allows a more reader friendly * version of the attribute name to be place in the :attribute place-holder. * * If no language line is specified for the attribute, a default formatting * will be used for the attribute. * * @param string $attribute * @return string */ protected function attribute($attribute) { $display = Lang::line('validation.attributes.' . $attribute)->get($this->language); return is_null($display) ? str_replace('_', ' ', $attribute) : $display; }
protected function attribute($attribute) { $bundle = Bundle::prefix($this->bundle); $line = "{$bundle}validation.attributes.{$attribute}"; if (Lang::has($line, $this->language)) { return Lang::line($line)->get($this->language); } else { return str_replace('_', ' ', $attribute); } }
/** * Executes the whois on a domain. * * @access protected * @param string * @return object * @throws Exception */ protected function whois($domain) { // Make sure we have both SLD and TLD. // if (!strpos($domain, '.')) { throw new Exception(Lang::line('domaintools::domaintools.invalid.domain', array('domain' => $domain))); } // Separate both Second Level Domain ( SLD ) and the Top Level Domain ( TLD ). // list($sld, $tld) = explode('.', $domain, 2); // Check if domain is valid. // if (!preg_match("/^([a-z0-9]([-a-z0-9]*[a-z0-9])?\\.)+((a[cdefgilmnoqrstuwxz]|aero|arpa)|(b[abdefghijmnorstvwyz]|biz)|(c[acdfghiklmnorsuvxyz]|cat|com|coop)|d[ejkmoz]|(e[ceghrstu]|edu)|f[ijkmor]|(g[abdefghilmnpqrstuwy]|gov)|h[kmnrtu]|(i[delmnoqrst]|info|int)|(j[emop]|jobs)|k[eghimnprwyz]|l[abcikrstuvy]|(m[acdghklmnopqrstuvwxyz]|mil|mobi|museum)|(n[acefgilopruz]|name|net)|(om|org)|(p[aefghklmnrstwy]|pro)|qa|r[eouw]|s[abcdeghijklmnortvyz]|(t[cdfghjklmnoprtvwz]|travel)|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw])\$/i", $domain)) { throw new Exception(Lang::line('domaintools::domaintools.invalid.domain', array('domain' => $domain))); } elseif (!array_key_exists($tld, $this->servers)) { throw new Exception(Lang::line('domaintools::domaintools.invalid.tld', array('tld' => $tld))); } // Get the needed data. // $server = $this->servers[$tld]['server']; $return = $this->servers[$tld]['return']; // Fallback data. // $result = array('domain' => $domain, 'sld' => $sld, 'tld' => $tld, 'whois' => null); $availability = 0; // // if (substr($return, 0, 12) == 'HTTPREQUEST-') { // Prepare the url. // $url = $server . $domain; // // $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); $data2 = ' ---' . $data; // // if (strpos($data2, substr($return, 12)) == true) { $availability = 1; } else { $availability = 2; $result['whois'] = nl2br(strip_tags($data)); } } else { $fp = @fsockopen($server, 43, $errno, $errstr, 10); if ($fp) { $data = ''; @fputs($fp, $domain . "\n"); @socket_set_timeout($fp, 10); while (!@feof($fp)) { $data .= @fread($fp, 4096); } @fclose($fp); $data2 = ' ---' . $data; if (strpos($data2, $return) == true) { $availability = 1; } else { $availability = 2; $result['whois'] = nl2br($data); } } } // Append some more data. // $result['availability'] = $availability; // Store the needed information. // $this->information = $result; $this->domain = $domain; $this->sld = $sld; $this->tld = $tld; // Return the object. // return $this; }