本文整理汇总了PHP中IUrl类的典型用法代码示例。如果您正苦于以下问题:PHP IUrl类的具体用法?PHP IUrl怎么用?PHP IUrl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IUrl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: call
/**
* @param Hypercharge\IUrl $url
* @param Hypercharge\IRequest $request
* @return Hypercharge\IResponse
* @throws Hypercharge\Error
*/
public function call(IUrl $url, IRequest $request)
{
$curl = Config::getFactory()->createHttpsClient(Config::getUser(), Config::getPassword());
$serializer = new XmlSerializer();
$responseStr = $curl->xmlPost($url->get(), $serializer->toXml($request));
$responseDom = new \SimpleXMLElement($responseStr);
return $request->createResponse(XmlSerializer::dom2hash($responseDom));
}
示例2: submenu
public static function submenu($limitright)
{
$controllerObj = Mysite::$app->getController();
$controller = $controllerObj->getcontroller();
$action = $controllerObj->getaction();
$currentlink = '/' . $controller . '/' . $action;
$vcurrent = '/' . $controller . '/';
$link = IUrl::creatUrl('/other/ucenter');
$linkarray = array();
$is_find = false;
$alllimit = self::$limitmenu;
$doarray = array_keys($alllimit);
//所有限制权限
$limitarray = explode(',', $limitright);
//拥有权限
foreach (self::$menu as $key => $value) {
$temsublink = array();
$defalturl = '';
$i = 0;
foreach ($value as $linkurl => $linkname) {
//panduan linkurl 是否存在 limitright;
//不存在continue;
$checkrightname = explode('/', $linkurl);
if (in_array($checkrightname[2], $doarray)) {
if (!in_array($checkrightname[2], $limitarray)) {
continue;
}
}
$tempone = array();
$tempone['is_curent'] = false;
if ($currentlink == $linkurl) {
$tempone['is_curent'] = true;
$is_find = true;
}
$linkurl = substr($linkurl, 1, strlen($linkurl));
$tempone['urls'] = IUrl::creatUrl($linkurl);
$tempone['name'] = $linkname;
$temsublink[] = $tempone;
if ($i == 0) {
$defalturl = $tempone['urls'];
}
$i++;
}
if (empty($defalturl)) {
continue;
}
$tempuplink = array();
$tempuolink['is_curent'] = false;
if ($is_find == true) {
$tempuolink['is_curent'] = true;
}
//continue;
$tempuolink['urls'] = $defalturl;
$tempuolink['name'] = $key;
$tempuolink['det'] = $temsublink;
$linkarray[] = $tempuolink;
$is_find = false;
}
return $linkarray;
}
示例3: savesingle
function savesingle()
{
$id = IReq::get('uid');
$data['addtime'] = strtotime(IReq::get('addtime') . ' 00:00:00');
$data['title'] = IReq::get('title');
$data['content'] = IReq::get('content');
$data['code'] = IReq::get('code');
$data['seo_key'] = IFilter::act(IReq::get('seo_key'));
$data['seo_content'] = IFilter::act(IReq::get('seo_content'));
if (empty($id)) {
$link = IUrl::creatUrl('adminpage/single/module/addsingle');
if (empty($data['content'])) {
$this->message('单页内容不能为空', $link);
}
if (empty($data['title'])) {
$this->message('单页标题不能为空', $link);
}
$this->mysql->insert(Mysite::$app->config['tablepre'] . 'single', $data);
} else {
$link = IUrl::creatUrl('single/addsingle/id/' . $id);
if (empty($data['content'])) {
$this->message('单页内容不能为空', $link);
}
if (empty($data['title'])) {
$this->message('单页标题不能为空', $link);
}
$this->mysql->update(Mysite::$app->config['tablepre'] . 'single', $data, "id='" . $id . "'");
}
$link = IUrl::creatUrl('adminpage/single/module/singlelist');
$this->success('操作成功', $link);
}
示例4: goods_img_upload
/**
* @brief 商品添加中图片上传的方法
*/
static function goods_img_upload()
{
//获得配置文件中的数据
$config = new Config("site_config");
$config_info = $config->getInfo();
$list_thumb_width = isset($config_info['list_thumb_width']) ? $config_info['list_thumb_width'] : 175;
$list_thumb_height = isset($config_info['list_thumb_height']) ? $config_info['list_thumb_height'] : 175;
$show_thumb_width = isset($config_info['show_thumb_width']) ? $config_info['show_thumb_width'] : 85;
$show_thumb_height = isset($config_info['show_thumb_height']) ? $config_info['show_thumb_height'] : 85;
//调用文件上传类
$photoObj = new PhotoUpload();
$photoObj->setThumb($show_thumb_width, $show_thumb_height, 'show');
$photoObj->setThumb($list_thumb_width, $list_thumb_height, 'list');
$photo = $photoObj->run();
//判断上传是否成功,如果float=1则成功
if ($photo['Filedata']['flag'] == 1) {
$list = $photo['Filedata']['thumb']['list'];
$list = strrchr($list, '/');
$id = substr($list, 1, strpos($list, '_') - 1);
$show = $photo['Filedata']['thumb']['show'];
$img = $photo['Filedata']['img'];
echo IUrl::creatUrl() . $show . '|' . $show . '|' . $img . '|' . $id . '|' . $photo['Filedata']['thumb']['list'] . '|' . '_' . $show_thumb_width . '_' . $show_thumb_height;
exit;
} else {
echo '0';
exit;
}
}
示例5: __construct
/**
* @brief 构造函数
* @param $payment_id 支付方式ID
*/
public function __construct($payment_id)
{
//回调函数地址
$this->callbackUrl = IUrl::getHost() . IUrl::creatUrl("/block/callback/_id/" . $payment_id);
//回调业务处理地址
$this->serverCallbackUrl = IUrl::getHost() . IUrl::creatUrl("/block/server_callback/_id/" . $payment_id);
}
示例6: user_ico_upload
function user_ico_upload()
{
$result = array('isError' => true);
if (isset($_FILES['attach']['name']) && $_FILES['attach']['name'] != '') {
$photoObj = new PhotoUpload();
$photo = $photoObj->run();
if ($photo['attach']['img']) {
$user_id = $this->user['user_id'];
$user_obj = new IModel('user');
$dataArray = array('head_ico' => $photo['attach']['img']);
$user_obj->setData($dataArray);
$where = 'id = ' . $user_id;
$isSuss = $user_obj->update($where);
if ($isSuss !== false) {
$result['isError'] = false;
$result['data'] = IUrl::creatUrl() . $photo['attach']['img'];
ISafe::set('head_ico', $dataArray['head_ico']);
} else {
$result['message'] = '上传失败';
}
} else {
$result['message'] = '上传失败';
}
} else {
$result['message'] = '请选择图片';
}
echo '<script type="text/javascript">parent.callback_user_ico(' . JSON::encode($result) . ');</script>';
}
示例7: __construct
/**
* 构造函数
* @param string $style 风格
*/
public function __construct($style = 'red')
{
$this->path = IUrl::creatUrl() . 'plugins/sonline/';
echo <<<OEF
\t<link rel="stylesheet" href="{$this->path}style/{$style}.css" />
\t<script type="text/javascript" src="{$this->path}js/jquery.Sonline.js"></script>
OEF;
}
示例8: get
public static function get($image_url, $width = 100, $height = 100)
{
$ext = strrchr($image_url, '.');
$end = intval("-" . strlen($ext));
$real_url = substr($image_url, 0, $end) . "_{$width}_{$height}" . $ext;
if (file_exists($real_url)) {
return IUrl::creatUrl("") . $real_url;
}
return IUrl::creatUrl("") . PhotoUpload::thumb($image_url, $width, $height, "_{$width}_{$height}");
}
示例9: getAuthorize
/**
* 获取版权信息,存储到缓存中进行比对
* @return boolean
*/
public static function getAuthorize()
{
$iwebshopAuthorize = ISafe::get('iwebshopAuthorize');
if ($iwebshopAuthorize === null) {
$return = self::send('_c=system&_a=authorize&host=' . IUrl::getHost());
$iwebshopAuthorize = isset($return['success']) && $return['success'] == 1 ? true : false;
ISafe::set('iwebshopAuthorize', $iwebshopAuthorize);
}
return $iwebshopAuthorize;
}
示例10: checkshoplogin
public function checkshoplogin()
{
$link = IUrl::creatUrl('member/shoplogin');
if ($this->member['uid'] == 0 && $this->admin['uid'] == 0) {
$this->message('未登陆', $link);
}
$shopid = ICookie::get('adminshopid');
if (empty($shopid)) {
$this->message('未登陆', $link);
}
}
示例11: wxmenu
function wxmenu()
{
//构造微信 menu
$wxtoken = Mysite::$app->config['wxtoken'];
$errorlink = IUrl::creatUrl('adminpage/weixin/module/wxset');
if (empty($wxtoken)) {
$this->message('未设置微信基本信息', $errorlink);
}
$data['wxmenu'] = $this->mysql->getarr("select * from " . Mysite::$app->config['tablepre'] . "wxmenu order by sort desc");
Mysite::$app->setdata($data);
}
示例12: __construct
/**
* @brief 构造函数
*/
public function __construct()
{
$payName = str_replace('pay_', '', get_class($this));
//获取域名地址
$sUrl = IUrl::getHost() . IUrl::creatUrl();
$sUrl = str_replace('plugins/', '', $sUrl);
//回调函数地址
$this->callbackUrl = str_replace('plugins/', '', IUrl::getHost() . IUrl::creatUrl("/block/callback/payment_name/{$payName}"));
//回调业务处理地址
$this->serverCallbackUrl = str_replace('plugins/', '', IUrl::getHost() . IUrl::creatUrl("/block/server_callback/payment_name/{$payName}"));
}
示例13: show
/**
* @brief 展示插件
* @param string $name 用户名
* @param string $pwd 密码
*/
public function show($name = '', $pwd = '')
{
$sessionName = ISafe::name();
$sessionId = ISafe::id();
$uploadUrl = IUrl::creatUrl($this->submit);
$admin_name = $name == '' ? ISafe::get('admin_name') : $name;
$admin_pwd = $pwd == '' ? ISafe::get('admin_pwd') : $pwd;
echo <<<OEF
\t\t<script type="text/javascript">
\t\twindow.onload = function()
\t\t{
\t\t\tnew SWFUpload({
\t\t\t\t// Backend Settings
\t\t\t\tupload_url: "{$uploadUrl}",
\t\t\t\tpost_params: {"{$sessionName}": "{$sessionId}","admin_name":"{$admin_name}","admin_pwd":"{$admin_pwd}"},
\t\t\t\t// File Upload Settings
\t\t\t\tfile_types : "*.jpg;*.jpge;*.png;*.gif",
\t\t\t\t// Event Handler Settings - these functions as defined in Handlers.js
\t\t\t\t// The handlers are not part of SWFUpload but are part of my website and control how
\t\t\t\t// my website reacts to the SWFUpload events.
\t\t\t\tswfupload_preload_handler : preLoad,
\t\t\t\tswfupload_load_failed_handler : loadFailed,
\t\t\t\tfile_queue_error_handler : fileQueueError,
\t\t\t\tfile_dialog_complete_handler : fileDialogComplete,
\t\t\t\tupload_progress_handler : uploadProgress,
\t\t\t\tupload_error_handler : uploadError,
\t\t\t\tupload_success_handler : uploadSuccess,
\t\t\t\tupload_complete_handler : uploadComplete,
\t\t\t\t// Button Settings
\t\t\t\tbutton_placeholder_id : "uploadButton",
\t\t\t\tbutton_width: 50,
\t\t\t\tbutton_height: 21,
\t\t\t\tbutton_text : '选择...',
\t\t\t\tbutton_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
\t\t\t\tbutton_cursor: SWFUpload.CURSOR.HAND,
\t\t\t\t// Flash Settings
\t\t\t\tflash_url : "{$this->path}swfupload.swf",
\t\t\t\tcustom_settings : {
\t\t\t\t\tupload_target : "divFileProgressContainer"
\t\t\t\t},
\t\t\t\t// Debug Settings
\t\t\t\tdebug: false
\t\t\t});
\t\t};
\t\t</script>
OEF;
}
示例14: savearea
function savearea()
{
$checinfo = Mysite::$app->config['psset'];
if (empty($checinfo)) {
$link = IUrl::creatUrl('area/adminpsset');
$this->message('请进行网站配送设置', $link);
}
$id = intval(IReq::get('uid'));
$data['name'] = IReq::get('name');
$data['orderid'] = intval(IReq::get('orderid'));
$data['pin'] = IReq::get('pin');
$data['parent_id'] = intval(IReq::get('parent_id'));
$data['imgurl'] = IReq::get('imgurl');
$data['is_com'] = intval(IReq::get('is_com'));
if (empty($id)) {
$data['lng'] = 0;
$data['lat'] = 0;
$link = IUrl::creatUrl('area/adminarealist');
if (empty($data['name'])) {
$this->message('地区名称不能为空', $link);
}
if (empty($data['pin'])) {
$this->message('拼音字母不能为空', $link);
}
if ($data['parent_id'] == 0 && empty($data['imgurl'])) {
$this->message('地址图标不能为空', $link);
}
$this->mysql->insert(Mysite::$app->config['tablepre'] . 'area', $data);
$areatempid = $this->mysql->insertid();
$tempdata['areaid'] = $areatempid;
$tempdata['shopid'] = 0;
$tempdata['cost'] = 0;
$this->mysql->insert(Mysite::$app->config['tablepre'] . "areatoadd", $tempdata);
$tempdata2['areaid'] = $areatempid;
$tempdata2['shopid'] = 0;
$this->mysql->insert(Mysite::$app->config['tablepre'] . "areashop", $tempdata2);
} else {
$link = IUrl::creatUrl('area/adminarealist/id/' . $id);
if (empty($data['name'])) {
$this->message('地区名称不能为空', $link);
}
if (empty($data['pin'])) {
$this->message('拼音字母不能为空', $link);
}
if ($data['parent_id'] == 0 && empty($data['imgurl'])) {
$this->message('地址图标不能为空', $link);
}
$this->mysql->update(Mysite::$app->config['tablepre'] . 'area', $data, "id='" . $id . "'");
}
$link = IUrl::creatUrl('area/adminarealist');
$this->success('操作成功!', $link);
}
示例15: createController
/**
* @brief 创建当前的Controller对象
* @return object Controller对象
*/
public function createController()
{
$controller = IUrl::getInfo("controller");
if ($controller === null) {
$controller = $this->defaultController;
}
if (class_exists($controller)) {
$controllerClass = new $controller($this, $controller);
} else {
$controllerClass = new IController($this, $controller);
}
$this->controller = $controllerClass;
return $controllerClass;
}