Пример #1
0
 /**
  * @group Urls
  * @group Auth
  */
 function testBackendLoginPage()
 {
     /**
      * Test that guest cannot access member area or authed areas
      * Test redirected to login page
      */
     $this->visit(zbase_url_from_route('admin'))->seePageIs(zbase_url_from_route('admin.login'));
     $this->assertEquals(302, $this->call('GET', zbase_url_from_route('admin'))->status());
 }
<?php

/**
 * Dx
 *
 * @link http://dennesabing.com
 * @author Dennes B Abing <*****@*****.**>
 * @license proprietary
 * @copyright Copyright (c) 2015 ClaremontDesign/MadLabs-Dx
 * @version 0.0.0.1
 * @since Mar 8, 2016 10:37:59 AM
 * @file widget.php
 * @project Expression project.name is undefined on line 13, column 15 in Templates/Scripting/EmptyPHP.php.
 * @package Expression package is undefined on line 14, column 15 in Templates/Scripting/EmptyPHP.php.
 *
 */
return ['type' => 'form', 'enable' => function () {
    return zbase_config_get('modules.account.widgets.notifications.enable', true);
}, 'config' => ['entity' => ['name' => 'user', 'method' => 'currentUser', 'repo' => ['method' => 'currentUser']], 'event' => ['email' => ['post' => ['redirect' => ['enable' => false]]]], 'form' => ['startTag' => ['action' => function () {
    if (zbase_is_back()) {
        return zbase_url_from_route('admin.account', ['action' => 'email']);
    }
}, 'html' => ['attributes' => ['class' => ['zbase-ajax-form']]]]], 'elements' => ['email' => ['type' => 'email', 'id' => 'email', 'label' => 'Email Address', 'entity' => ['property' => 'email'], 'angular' => ['ngModel' => 'currentUser.email'], 'html' => ['attributes' => ['input' => ['autocomplete' => 'off']]], 'validations' => ['required' => ['enable' => true, 'message' => 'Email address is required.'], 'unique' => ['enable' => true, 'text' => function () {
    return 'unique:' . zbase_entity('user')->getTable() . ',email,' . zbase_auth_user()->id() . ',user_id';
}, 'message' => 'Email address already exists.'], 'not_in' => ['enable' => true, 'text' => function () {
    return 'not_in:' . zbase_auth_user()->email;
}, 'message' => 'Please provide a different email address.']]]]]];
Пример #3
0
    echo zbase_url_from_route('account');
    ?>
">
								<i class="fa fa-user"></i> My Profile
							</a>
						</li>
						<li class="divider">
						</li>
						<li>
							<a href="javascript:;" id="trigger_fullscreen">
								<i class="fa fa-arrows"></i> Full Screen
							</a>
						</li>
						<li>
							<a href="<?php 
    echo zbase_url_from_route('logout');
    ?>
">
								<i class="fa fa-key"></i> Log Out
							</a>
						</li>
					</ul>
				</li>
			<?php 
}
?>
			<!-- END USER LOGIN DROPDOWN -->
		</ul>
		<!-- END TOP NAVIGATION MENU -->
	</div>
	<!-- END TOP NAVIGATION BAR -->
Пример #4
0
/**
 * 'url' => '/api/{username}/{key}/{format}/{module}/{object}/{method}/{paramOne?}/{paramTwo?}/{paramThree?}/{paramFour?}/{paramFive?}/{paramSix?}',
 * Create an API URL
 * @param array $params
 * @return string
 */
function zbase_api_url($params)
{
    $array = [];
    $array['username'] = !empty($params['username']) ? $params['username'] : '******';
    $array['key'] = !empty($params['key']) ? $params['key'] : 'key';
    $array['format'] = !empty($params['format']) ? $params['format'] : 'json';
    $array['module'] = !empty($params['module']) ? $params['module'] : null;
    $array['object'] = !empty($params['object']) ? $params['object'] : null;
    $array['method'] = !empty($params['method']) ? $params['method'] : null;
    $array['paramOne'] = !empty($params['paramOne']) ? $params['paramOne'] : null;
    $array['paramTwo'] = !empty($params['paramTwo']) ? $params['paramTwo'] : null;
    $array['paramThree'] = !empty($params['paramThree']) ? $params['paramThree'] : null;
    $array['paramFour'] = !empty($params['paramFour']) ? $params['paramFour'] : null;
    $array['paramFive'] = !empty($params['paramFive']) ? $params['paramFive'] : null;
    $array['paramSix'] = !empty($params['paramSix']) ? $params['paramSix'] : null;
    return zbase_url_from_route('api', $array);
}
Пример #5
0
		</head>
		<body ui-prevent-touchmove-defaults>

			<?php 
    if (zbase_auth_has()) {
        ?>
				<!-- Sidebars -->
				<div ng-include="'<?php 
        echo zbase_url_from_route('admin-angular-mobile-sidebar');
        ?>
?at=1'"
					 ui-track-as-search-param='true'
					 class="sidebar sidebar-left"></div>

				<div ng-include="'<?php 
        echo zbase_url_from_route('admin-angular-mobile-sidebar-right');
        ?>
?at=1'"
					 class="sidebar sidebar-right"></div>

				<div class="app"
					 ui-swipe-right='Ui.turnOn("uiSidebarLeft")'
					 ui-swipe-left='Ui.turnOff("uiSidebarLeft")'>

					<!-- Navbars -->
					<div class="navbar navbar-app navbar-absolute-top">
						<div class="navbar-brand navbar-brand-center" ui-yield-to="title">
							<% viewTitle %>
						</div>
						<div class="btn-group pull-left">
							<div ui-toggle="uiSidebarLeft" class="btn sidebar-toggle">
 * $code = The Code
 *
 * /account/email/verify?e=email&c=$code
 * zbase_url_from_route('account', ['action' => 'email','task' => 'verify','e' => $newEmailAddress,'c' => $code])
 */
?>

<?php 
echo zbase_view_render(zbase_view_file_contents('email.header'));
?>

<h1>Email Address verification</h1>
<p>To be able to continue, we need to verify your email address
<br />
Email Address: <?php 
echo $newEmailAddress;
?>
Code: <strong><?php 
echo $code;
?>
</strong>
<br />
<br />
<a href="<?php 
echo zbase_url_from_route('account', ['action' => 'email', 'task' => 'verify', 'e' => $newEmailAddress, 'c' => $code]);
?>
">Click here</a> to verify your email address.
</p>

<?php 
echo zbase_view_render(zbase_view_file_contents('email.footer'));
Пример #7
0
 /**
  * Return the image url
  *
  * @return string
  */
 public function imageUrl($options = [])
 {
     $fullImage = false;
     $params = ['node' => static::$nodeNamePrefix];
     if ($this->singleImage) {
         $params['id'] = $this->alphaId();
     } else {
         $params['id'] = $this->imageId();
     }
     if (empty($options) || !empty($options['full'])) {
         $fullImage = true;
     }
     $params['w'] = !empty($options['w']) ? $options['w'] : 150;
     $params['h'] = !empty($options['h']) ? $options['h'] : 0;
     $params['q'] = !empty($options['q']) ? $options['q'] : 80;
     if (!empty($options['thumbnail'])) {
         $params['w'] = !empty($options['w']) ? $options['w'] : 200;
         $params['h'] = !empty($options['h']) ? $options['h'] : 0;
         $params['q'] = !empty($options['q']) ? $options['q'] : 80;
     }
     $params['ext'] = zbase_config_get('node.files.image.format', 'png');
     return zbase_url_from_route('nodeImage', $params);
 }
Пример #8
0
<?php

/**
 * Dx
 *
 * @link http://dennesabing.com
 * @author Dennes B Abing <*****@*****.**>
 * @license proprietary
 * @copyright Copyright (c) 2015 ClaremontDesign/MadLabs-Dx
 * @version 0.0.0.1
 * @since Apr 1, 2016 10:21:39 PM
 * @file msgbutton.blade.php
 * @project Expression project.name is undefined on line 13, column 15 in Templates/Scripting/EmptyPHP.php.
 * @package Expression package is undefined on line 14, column 15 in Templates/Scripting/EmptyPHP.php.
 */
?>
<!--<div class="alert alert-danger">Are you sure you want to delete?</div>-->
<div class="btn-group" role="group" aria-label="Message buttons">
	<button type="button" class="btn btn-danger btn-sm zbase-btn-action-confirm"
			data-config="{url: '<?php 
echo zbase_url_from_route('messages', array('action' => 'trash', 'id' => $msg->alphaId()));
?>
',
			mode: 'yesno',
			message: 'Are you sure you want to delete this message?',
			}">Delete</button>
</div>
Пример #9
0
 /**
  * Url to a file
  *
  * @return string
  */
 public function postFileUrl($file = null, $action = 'view', $options = [])
 {
     if (method_exists($this, 'fileUrl')) {
         return $this->fileUrl($file, $action, $options);
     }
     $task = null;
     if (is_object($file) && !empty($file->name)) {
         $task = $file->name;
     }
     if (is_object($file) && !empty($file->filename)) {
         $task = $file->filename;
     }
     if (is_string($file)) {
         $task = $file;
     }
     $action = str_replace('file-', '', $action);
     if ($action != 'delete') {
         //			if(!empty($options['thumbnail']))
         //			{
         //				$width = 100;
         //				$height = 100;
         //				$task = '100x100_' . $task;
         //			}
         //			$width = !empty($options['w']) ? $options['w'] : (!empty($width) ? $width : null);
         //			$height = !empty($options['h']) ? $options['h'] : (!empty($height) ? $height : null);
     }
     if (zbase_auth_user()->isAdmin()) {
         return zbase_url_from_route('admin.file', ['table' => $this->postTableName(), 'action' => $action, 'id' => $this->postId(), 'file' => $task]);
     } else {
         return zbase_url_from_route('file', ['table' => $this->postTableName(), 'action' => $action, 'id' => $this->postId(), 'file' => $task]);
     }
 }
Пример #10
0
 /**
  * Return this URL for Action
  */
 public function actionUrl($action, $task = null)
 {
     $params = ['action' => $action, 'task' => $task];
     $params['id'] = $this->alphaId();
     if (zbase_is_back()) {
         return zbase_url_from_route('admin.' . $this->actionUrlRouteName(), $params);
     }
     return zbase_url_from_route($this->actionUrlRouteName(), $params);
 }
Пример #11
0
/**
 * Render HTML before </body>
 *
 * @return string
 */
function zbase_view_render_body()
{
    $str = '';
    zbase()->view()->prepare();
    $onloadScripts = zbase_view_placeholder_render('body_scripts_onload');
    $str .= zbase_view_placeholder_render('body_javascripts');
    $str .= zbase_view_placeholder_render('body_footer_html');
    $str .= EOF . '<script type="text/javascript">';
    $str .= EOF . zbase_view_compile(zbase_view_placeholder_render('body_scripts'));
    if (!empty(zbase_auth_is_duplex())) {
        $onloadScripts .= 'jQuery(\'body\').append(\'<div style="margin:0px auto;z-index:999999;background:yellow;width: auto;position:absolute;top:0px;padding:5px;margin-top:2px;margin-left:2px;">You are loggedin as: ' . zbase_auth_user()->displayFullDetails() . ' <a class="btn btn-danger btn-sm" href="' . zbase_url_from_route('admin.duplex', ['action' => 'unduplex']) . '">SignOut</a></div>\');';
    }
    if (!empty($onloadScripts)) {
        $str .= EOF . 'jQuery(document).ready(function(){' . EOF . $onloadScripts . EOF . '});';
    }
    $str .= EOF . '</script>';
    return $str;
}
if (zbase()->system()->inMaintenance()) {
    ?>
	<div class="alert alert-danger text-center">
		<a href="<?php 
    echo zbase_url_from_route('admin.system', ['action' => 'maintenance-mode-off']);
    ?>
" class="btn btn-danger">Stop Maintenance Mode</a>
		<br />
		<br />
		Website is currently in <strong>maintenance mode</strong>.
	</div>
<?php 
} else {
    ?>
	<div class="alert alert-info text-center">
		<a href="<?php 
    echo zbase_url_from_route('admin.system', ['action' => 'maintenance-mode-on']);
    ?>
" class="btn btn-info">Set to Maintenance Mode</a>
		<br />
		<br />
		When <strong>maintenance mode</strong> is enabled,<br />
		a maintenance message will be displayed when someone accesses the site.
		Your current IP Address of <strong><?php 
    echo zbase_ip();
    ?>
</strong> will be excluded.
	</div>
<?php 
}
Пример #13
0
 /**
  * The Image
  */
 public function src()
 {
     return zbase_url_from_route('siteImageWatermark', ['f' => $this->filename]);
 }
Пример #14
0
<!-- BEGIN SIDEBAR -->
	<div class="page-sidebar navbar-collapse collapse">
		<!-- BEGIN SIDEBAR MENU -->
		<ul class="page-sidebar-menu" data-auto-scroll="true" data-slide-speed="200">
			<li class="sidebar-toggler-wrapper">
				<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
				<div class="sidebar-toggler hidden-phone">
				</div>
				<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
			</li>
			<li class="start ">
				<a href="<?php 
echo zbase_url_from_route('admin');
?>
">
					<i class="fa fa-home"></i>
					<span class="title">
						Dashboard
					</span>
				</a>
			</li>
			<?php 
$modules = zbase()->modules();
$navs = [];
foreach ($modules as $module) {
    if ($module->hasNavigation(zbase_section())) {
        $navs[] = $module;
    }
}
$navs = zbase_collection($navs)->sortByDesc(function ($itm) {
    return $itm->getNavigationOrder();
Пример #15
0
 /**
  * First step in updating email address.
  * 	- Code will be sent to the old email address with a verification code
  * @param string $newEmailAddress
  * @return boolean
  */
 public function updateRequestEmailAddress($newEmailAddress)
 {
     if (!empty($newEmailAddress) && $this->email() != $newEmailAddress) {
         zbase_db_transaction_start();
         try {
             /**
              * Admin is changing the email Address
              */
             if (zbase_auth_user()->id() != $this->id() && zbase_auth_user()->isAdmin()) {
                 /**
                  * Send a request code to the old email address
                  * option: email_verification_code: code; new_email: $newEmail Address
                  */
                 $oldEmail = $this->email();
                 $this->email = $newEmailAddress;
                 $this->email_verified = 0;
                 $this->save();
                 zbase_alert('info', _zt($this->displayFullDetails() . ' email address was updated to <strong>%email%</strong> from <strong>' . $oldEmail . '</strong>.', ['%email%' => $this->email()]));
                 $this->log('user::updateRequestEmailAddress', null, ['new_email' => $newEmailAddress, 'admin_id' => zbase_auth_user()->id()]);
             } else {
                 /**
                  * Send a request code to the old email address
                  * option: email_verification_code: code; new_email: $newEmail Address
                  */
                 $code = zbase_generate_code();
                 $this->setDataOption('email_updaterequest_code', $code);
                 $this->setDataOption('email_new', $newEmailAddress);
                 $this->setDataOption('email_new_request_date', zbase_date_now());
                 $this->save();
                 $url = zbase_url_from_route('update-email-request', ['email' => $this->email(), 'token' => $code]);
                 $urlText = null;
                 if (zbase_is_dev()) {
                     $urlText = '<a href="' . $url . '">' . $url . '</a>';
                     zbase()->json()->setVariable('updateRequestEmailAddress', $url);
                 }
                 zbase_alert('info', _zt('We sent an email to %email% with a link to complete the process of updating your email address.' . $urlText, ['%email%' => $this->email()]));
                 zbase_messenger_email($this->email(), 'account-noreply', _zt('New Email address update request'), zbase_view_file_contents('email.account.newEmailAddressRequest'), ['entity' => $this, 'newEmailAddress' => $newEmailAddress, 'code' => $code, 'url' => $url]);
                 $this->log('user::updateRequestEmailAddress', null, ['new_email' => $newEmailAddress]);
             }
             zbase_db_transaction_commit();
             return true;
         } catch (\Zbase\Exceptions\RuntimeException $e) {
             zbase_db_transaction_rollback();
             return false;
         }
     } else {
         zbase_alert('info', _zt('We sent an email to %email% with a link to complete the process of updating your email address.', ['%email%' => $this->email()]));
     }
 }
Пример #16
0
@extends(zbase_view_template_layout())
@section('content')
Site Index
| <a href="<?php 
echo zbase_url_from_route('admin');
?>
">Admin</a>
| <a href="<?php 
echo zbase_url_from_route('login');
?>
">Login</a>
| <a href="<?php 
echo zbase_url_from_route('register');
?>
">Register</a>
@stop
Пример #17
0
<?php

/**
 * Dx
 *
 * @link http://dennesabing.com
 * @author Dennes B Abing <*****@*****.**>
 * @license proprietary
 * @copyright Copyright (c) 2015 ClaremontDesign/MadLabs-Dx
 * @version 0.0.0.1
 * @since Mar 5, 2016 11:51:42 PM
 * @file module.php
 * @project Expression project.name is undefined on line 13, column 15 in Templates/Scripting/EmptyPHP.php.
 * @package Expression package is undefined on line 14, column 15 in Templates/Scripting/EmptyPHP.php.
 *
 */
return ['id' => 'angular', 'enable' => false, 'access' => 'admin', 'class' => null, 'backend' => false, 'frontend' => false, 'url' => ['backend' => 'a-{action?}'], 'routes' => ['angular-js' => ['url' => 'admin/zbase-angular.js', 'view' => ['enable' => true, 'layout' => 'blank', 'name' => 'type.js', 'content' => function () {
    return zbase_view_render(zbase_view_file_module('angular.views.back.mobile.js'));
}]], 'admin-angular-mobile-sidebar' => ['backend' => true, 'url' => 'admin/mobile/angular/sidebar.html', 'view' => ['enable' => true, 'layout' => 'blank', 'name' => 'type.html', 'content' => function () {
    return zbase_view_render(zbase_view_file_module('angular.views.back.mobile.templates.sidebar'));
}], 'middleware' => ['admin' => true]], 'admin-angular-mobile-sidebar-right' => ['backend' => true, 'url' => 'admin/mobile/angular/sidebar-right.html', 'view' => ['enable' => true, 'layout' => 'blank', 'name' => 'type.html', 'content' => function () {
    return zbase_view_render(zbase_view_file_module('angular.views.back.mobile.templates.sidebar-right'));
}], 'middleware' => ['admin' => true]], 'admin-angular-mobile-dashboard-template' => ['backend' => true, 'url' => 'admin/mobile/angular/dashboard.html', 'view' => ['enable' => true, 'layout' => 'blank', 'name' => 'type.html', 'content' => function () {
    return zbase_view_render(zbase_view_file_module('angular.views.back.mobile.templates.dashboard'));
}], 'middleware' => ['admin' => true]]], 'angular' => ['mobile' => ['backend' => ['routeProvider' => [['url' => '/', 'templateUrl' => function () {
    return zbase_url_from_route('admin-angular-mobile-dashboard-template', [], true);
}, 'controller' => 'adminDashboardController']], 'controllers' => [['controller' => 'adminDashboardController', 'view' => ['file' => function () {
    return zbase_view_render(zbase_view_file_module('angular.views.back.mobile.controllers.adminDashboardController'));
}]]]]]], 'widgets' => ['back' => ['controller' => ['action' => []]]]];
<?php

/**
 * Dx
 *
 * @link http://dennesabing.com
 * @author Dennes B Abing <*****@*****.**>
 * @license proprietary
 * @copyright Copyright (c) 2015 ClaremontDesign/MadLabs-Dx
 * @version 0.0.0.1
 * @since Mar 8, 2016 10:37:59 AM
 * @file widget.php
 * @project Expression project.name is undefined on line 13, column 15 in Templates/Scripting/EmptyPHP.php.
 * @package Expression package is undefined on line 14, column 15 in Templates/Scripting/EmptyPHP.php.
 *
 */
return ['type' => 'form', 'enable' => true, 'config' => ['access' => 'only::sudo', 'values' => ['default' => ['enable' => true, 'array' => function () {
    return zbase()->telegram()->settings();
}]], 'entity' => null, 'elements' => ['status' => ['type' => 'select', 'id' => 'status', 'label' => 'Status', 'multiOptions' => 'enableDisable', 'help' => ['text' => 'Disable telegram messaging.']], 'botusername' => ['type' => 'text', 'id' => 'botusername', 'label' => 'Bot Name', 'html' => ['attributes' => ['input' => ['placeholder' => 'Bot Username']]]], 'bottoken' => ['type' => 'text', 'id' => 'bottoken', 'label' => 'Bot Token', 'html' => ['attributes' => ['input' => ['placeholder' => 'Bot Token']]]], 'webhook' => ['type' => 'text', 'id' => 'webhook', 'label' => 'WebHook (Optional)', 'html' => ['attributes' => ['input' => ['value' => function () {
    $token = zbase()->telegram()->token();
    if (!empty($token)) {
        return zbase_url_from_route('telegramhook', ['token' => $token]);
    }
}, 'placeholder' => 'Webhook']]]], 'testmessage' => ['type' => 'select', 'id' => 'testmessage', 'label' => 'Send Test Message', 'multiOptions' => 'yesNo', 'help' => ['text' => 'Will send test message to Dennes.']]]]];
Пример #19
0
<p>
	<img src="/zbase/assets/zivsluck/img/promo/100off.png" alt="100.00 Off on your next order" class="img-shadow img-responsive">
</p>
<p>
	<br />
	To avail of the 100.00 discount on your next order:
<ul>
	<li>Complete your first order.</li>
	<li>Next order should be of the same material as the first order.</li>
	<li>First Name and Last Name should be the same from the first order.</li>
	<li>Next order should be delivered on the same address as the first order.</li>
	<li>Next order should be completed within the day or in the next 24 hours since the first order was made.</li>
	<li>Discount can only be used on the next order.</li>
	<li>Discount will be reflected on the Order Confirmation page.</li>
	<li>If discount was already used, you can get another 100.00 discount by completing another order.</li>
	<li>For the discounted order to be processed, payment for the first and the discounted order should be completed.</li>
	<li><strong>No Payment, no Processing of Order</strong>.</li>
</ul>
</p>
<p>&nbsp;</p>
<p><a class="btn btn-success btn-next" href="<?php 
echo zbase_url_from_route('customize');
?>
">Create your order now!</a></p>
<p>&nbsp;</p>
Пример #20
0
 /**
  * Return the Image Src
  * @return string
  */
 public function imageSrc($task = null)
 {
     $id = $this->maskedId();
     return zbase_url_from_route('order', compact('id', 'task'));
 }
Пример #21
0
 public function controllerIndex()
 {
     if (!$this->getModule()->hasAccess()) {
         if (zbase_auth_has()) {
             return $this->unathorized(_zt('You don\'t have enough access to the resource.'));
         } else {
             return redirect()->to(zbase_url_from_route('login'));
         }
     }
     /**
      * Check for widgets
      */
     $widgetsAction = $action = str_replace('.', '-', $this->getRouteParameter('action', 'index'));
     $requestMethod = zbase_request_method();
     if (!empty($this->nodeName)) {
         $widgetsAction = $requestMethod . '-node-' . $this->nodeName . '-' . $action;
         $htmls = [];
     }
     $isAjax = zbase_request_is_ajax();
     if ($isAjax) {
         $widgetsAction = (!empty($this->nodeName) ? $requestMethod . '-node-' . $this->nodeName . '-' : '') . 'json-' . $action;
         $htmls = [];
     }
     if ($this->getModule()->hasAction($requestMethod . '-' . $action)) {
         $widgetsAction = $requestMethod . '-' . $action;
         $action = $widgetsAction;
         $htmls = [];
     }
     $widgets = $this->getModule()->pageProperties($action)->widgetsByControllerAction($widgetsAction);
     if (count($widgets) == 1) {
         $firstWidget = collect($widgets)->first();
         if ($firstWidget instanceof \Zbase\Widgets\WidgetInterface) {
             $firstWidget->pageProperties($widgetsAction);
         }
     }
     if (!is_array($widgets) && $widgets instanceof \Illuminate\Http\RedirectResponse) {
         return $widgets;
     }
     zbase()->json()->addVariable('_widget', $this->getModule()->id() . '_' . str_replace('-', '', $action));
     if (zbase_is_dev()) {
         zbase()->json()->addVariable(__METHOD__, $widgetsAction);
         if (zbase_request_is_post()) {
             zbase()->json()->addVariable('_POST_PARAMETERS', zbase_request_inputs());
         }
         zbase()->json()->addVariable('_ROUTE_PARAMETERS', zbase_route_inputs());
         zbase()->json()->addVariable('_GET_PARAMETERS', zbase_request_query_inputs());
     }
     // dd($this->getModule(), $widgetsAction, $widgets);
     if (empty($widgets)) {
         return zbase_abort(404);
     }
     foreach ($widgets as $widget) {
         if (!empty($this->nodeName)) {
             zbase()->json()->addVariable('node', ['prefix' => $this->getModule()->nodeNamespace(), 'name' => $this->nodeName, 'support' => 1]);
             $widget->setNodename($this->nodeName)->setNodeSupport(true);
         }
         if ($widget instanceof \Zbase\Widgets\ControllerInterface) {
             $v = $widget->validateWidget($action);
             if ($v instanceof \Illuminate\Contracts\Validation\Validator) {
                 if ($isAjax) {
                     zbase()->json()->addVariable('errors', $v->errors()->getMessages());
                     return new \Illuminate\Http\JsonResponse($v->errors()->getMessages(), 422);
                 } else {
                     return redirect()->to($this->getRedirectUrl())->withInput(zbase_request_inputs())->withErrors($v->errors()->getMessages());
                 }
             }
             $ret = $widget->controller($this->getRouteParameter('action', 'index'));
             if ($ret instanceof \Zbase\Exceptions\NotFoundHttpException) {
                 return $this->notFound();
             }
             if ($ret instanceof \Zbase\Exceptions\UnauthorizedException) {
                 return $this->unathorized();
             }
             if ($ret instanceof \Zbase\Exceptions\Exception) {
                 return $this->error();
             }
             if ($ret instanceof \Illuminate\Http\RedirectResponse) {
                 if ($isAjax) {
                     zbase()->json()->addVariable('redirect', $ret->getTargetUrl());
                 } else {
                     return $ret;
                 }
             }
             if (zbase_is_json()) {
                 zbase_response_format_set('json');
                 $jsonIndexName = $widget->getWidgetPrefix();
                 if (zbase_is_angular()) {
                     if ($widget instanceof \Zbase\Widgets\Type\Datatable) {
                         $angularTemplate = zbase_angular_widget_datatable($this->getModule(), $widget);
                         $jsonIndexName = $angularTemplate['serviceName'];
                     }
                 }
                 if (zbase_is_dev()) {
                     zbase()->json()->addVariable('$jsonIndexName', $jsonIndexName);
                 }
                 if (!$widget->isExporting()) {
                     zbase()->json()->addVariable($jsonIndexName, $widget->toArray());
                 }
             } else {
                 if ($isAjax) {
                     $htmls[str_replace('-', '_', $widget->id())] = $widget->render();
                 }
             }
             $widget->pageProperties($widgetsAction);
         }
     }
     if (!empty($isAjax)) {
         zbase()->json()->addVariable('_widgets', 1);
         zbase()->json()->addVariable('html', $htmls);
     } else {
         return $this->view(zbase_view_file('module.index'), array('module' => $this->getModule(), 'widgets' => $widgets));
     }
 }
Пример #22
0
 public function readUrl()
 {
     return zbase_url_from_route('messages', ['action' => 'read', 'id' => $this->alphaId()]);
 }
Пример #23
0
 *
 * @link http://dennesabing.com
 * @author Dennes B Abing <*****@*****.**>
 * @license proprietary
 * @copyright Copyright (c) 2015 ClaremontDesign/MadLabs-Dx
 * @version 0.0.0.1
 * @since Mar 8, 2016 10:37:59 AM
 * @file widget.php
 * @project Expression project.name is undefined on line 13, column 15 in Templates/Scripting/EmptyPHP.php.
 * @package Expression package is undefined on line 14, column 15 in Templates/Scripting/EmptyPHP.php.
 *
 */
return ['type' => 'form', 'enable' => function () {
    return zbase_config_get('modules.account.widgets.username.enable', true);
}, 'config' => ['entity' => ['name' => 'user', 'node' => ['enable' => true], 'repo' => ['byId' => ['route' => 'id']]], 'event' => ['username' => ['post' => ['redirect' => ['enable' => false]]]], 'submit' => ['button' => ['label' => 'Update Username']], 'form' => ['startTag' => ['action' => function () {
    return zbase_url_from_route('admin.users', ['action' => 'username', 'id' => zbase_route_input('id')]);
}, 'html' => ['attributes' => ['class' => ['zbase-ajax-form']]]]], 'elements' => ['username' => ['type' => 'text', 'id' => 'username', 'enable' => function () {
    return zbase_config_get('auth.username.enable', false);
}, 'label' => 'Username', 'entity' => ['property' => 'username'], 'angular' => ['ngModel' => 'currentUser.username'], 'validations' => ['required' => ['enable' => true, 'message' => 'Username is required.'], 'unique' => ['enable' => true, 'text' => function () {
    return 'unique:' . zbase_entity('user')->getTable() . ',username,' . zbase_auth_user()->id() . ',user_id';
}, 'message' => 'Username already exists.'], 'regex' => ['enable' => true, 'text' => function () {
    return 'regex:/^[a-z][a-z0-9]{5,31}$/';
}, 'message' => 'Invalid username.'], 'min' => ['enable' => true, 'text' => function () {
    return 'min:5';
}, 'message' => 'Username should be of 5 up to 32 characters.'], 'max' => ['enable' => true, 'text' => function () {
    return 'max:32';
}, 'message' => 'Username should be of 5 up to 32 characters.'], 'not_in' => ['enable' => true, 'text' => function () {
    $notAllowedUsernames = (require zbase_path_library('notallowedusernames.php'));
    $notAllowedUsernames[] = zbase_auth_user()->username();
    return 'not_in:' . implode(',', $notAllowedUsernames);
}, 'message' => 'Please provide a different username.']]]]]];
Пример #24
0
 /**
  * Create a URL based from params
  * @param string $section The Section to generate the route
  * @param array $params Params to generate route
  * @return string
  */
 public function url($section, $params)
 {
     if ($section == 'backend' || $section == 'back') {
         $adminKey = zbase_config_get('routes.adminkey.key', 'admin');
         $routeName = $adminKey . '.' . $this->id();
     } else {
         $routeName = $this->id();
     }
     return zbase_url_from_route($routeName, $params);
 }
Пример #25
0
    if (!empty($emailVerificationEnabled)) {
        ?>
		<h1>Welcome to <?php 
        echo zbase_site_name();
        ?>
</h1>

		<p>Below is your Email verification code</p>
		<span>Email: <?php 
        echo $entity->email();
        ?>
</span>
		<br />
		<span>Code: <?php 
        echo $code;
        ?>
</span>
		<br />
		<br />
		<a href="<?php 
        echo zbase_url_from_route('account', ['action' => 'email', 'task' => 'verify', 'e' => $entity->email(), 'c' => $code]);
        ?>
">Click here to verify</a>

	<?php 
    }
}
?>

	<?php 
echo zbase_view_render(zbase_view_file_contents('email.footer'));
Пример #26
0
 /**
  * Return the HREF attribute
  * @return string
  */
 public function href()
 {
     $route = $this->route;
     if (!empty($route)) {
         return zbase_url_from_route($route, $this->routeParams, true);
     }
     return null;
 }
Пример #27
0
 /**
  * Url
  * @param string $routeName
  * @param array $params
  * @return string
  */
 public function url($routeName, $params = [])
 {
     return zbase_url_from_route($routeName, $params);
 }
Пример #28
0
<?php

$checkout = zbase_config_get('zivsluck.checkout.enable', false);
if (!empty($checkout)) {
    ?>
<div id="confirmOrderForm" style="display: none;">
	<h1>Please confirm your order below.</h1>
	<div class="col-md-12">
		<h3>Terms and Conditions</h3>
		<ul>
			<li>Confirmation message will be sent via SMS and Facebook message to confirm availability of your order.</li>
			<li>Once order has been confirmed, you need to send the payment via available methods.</li>
			<li>Once payment has been made, please send us a copy of the deposit slip as Proof of Payment.</li>
			<li>You can send to us the deposit/payment slip using the Update Order page at
				<a target="_blank" href="<?php 
    echo zbase_url_from_route('orderUpdate');
    ?>
">http://zivsluck.com/update-order</a>.</li>
			<li><strong>No Proof of Payment, No Processing of Order.</strong></li>
			<li>No cancellation of order once payment has been made.</li>
			<li>No rush orders</li>
		</ul>
	</div>

	<div class="col-md-12">
		<h3>Pay only through these Remittance Centers:</h3>
		<?php 
    $paymentCenters = zbase_config_get('zivsluck.paymentCenters');
    if (!empty($paymentCenters)) {
        foreach ($paymentCenters as $paymentCenter) {
            if (!empty($paymentCenter['enable'])) {
Пример #29
0
<br />
@section('body_bottom')
<?php 
if (!empty($image)) {
    ?>
	<script type="text/javascript">
		jQuery(document).ready(function () {
			jQuery('#btnSaveTags').click(function () {
				var data = {'font': jQuery('#font').val(), 'material': jQuery('#material').val(), 'image': '<?php 
    echo $image->name();
    ?>
'};
				$.ajax({
					type: 'post',
					url: '<?php 
    echo zbase_url_from_route('siteImageUpload');
    ?>
',
					data: data,
					beforeSend: function () {
						jQuery('#btnSaveTags').text('Saving...').removeClass('btn-success').addClass('btn-default').attr('disabled', true);
					},
					success: function () {
						jQuery('#btnSaveTags').text('Save').removeClass('btn-default').addClass('btn-success').attr('disabled',false);
					}
				});
			});
			jQuery('#btnDownload').click(function () {
				window.location = '<?php 
    echo $image->src();
    ?>
Пример #30
0
<?php

/**
 * Dx
 *
 * @link http://dennesabing.com
 * @author Dennes B Abing <*****@*****.**>
 * @license proprietary
 * @copyright Copyright (c) 2015 ClaremontDesign/MadLabs-Dx
 * @version 0.0.0.1
 * @since Mar 8, 2016 10:37:59 AM
 * @file widget.php
 * @project Expression project.name is undefined on line 13, column 15 in Templates/Scripting/EmptyPHP.php.
 * @package Expression package is undefined on line 14, column 15 in Templates/Scripting/EmptyPHP.php.
 *
 */
return ['type' => 'form', 'enable' => function () {
    return zbase_config_get('modules.account.widgets.profile.enable', true);
}, 'config' => ['entity' => ['name' => 'user', 'method' => 'currentUser', 'repo' => ['method' => 'currentUser']], 'event' => ['profile' => ['post' => ['redirect' => ['enable' => false]]]], 'submit' => ['button' => ['label' => 'Update Profile']], 'form' => ['startTag' => ['action' => function () {
    if (zbase_is_back()) {
        return zbase_url_from_route('admin.account', ['action' => 'profile']);
    }
    return zbase_url_from_route('account', ['action' => 'profile']);
}, 'html' => ['attributes' => ['class' => ['zbase-ajax-form']]]]], 'elements' => ['first_name' => ['type' => 'text', 'id' => 'first_name', 'enable' => true, 'label' => 'First Name', 'entity' => ['property' => 'first_name']], 'last_name' => ['type' => 'text', 'id' => 'last_name', 'enable' => true, 'label' => 'Last Name', 'entity' => ['property' => 'last_name']]]]];