Пример #1
0
/**
 * Main function to create the parameters passed to the view.
 *
 * @return array
 */
function get_dashboard()
{
    global $privileges;
    require_once realpath(__DIR__ . '/../controller/api.php');
    $shifts = getAllUpcomingShifts();
    $viewData = array('number_upcoming_shifts' => block(array('description' => _("Angels needed in the next 3 hrs"), 'number' => countUpcomingNeededAngels($shifts, 3 * 60 * 60)), BLOCK_TYPE_COUNTER), 'number_upcoming_night_shifts' => block(array('description' => _("Angels needed for night shifts"), 'number' => getNumberUpcomingNightShifts()), BLOCK_TYPE_COUNTER), 'number_currently_working' => block(array('description' => _("Angels currently working"), 'number' => getCurrentlyWorkingAngels()), BLOCK_TYPE_COUNTER), 'number_hours_worked' => block(array('description' => _("Hours to be worked"), 'number' => countHoursToBeWorked($shifts)), BLOCK_TYPE_COUNTER), 'my_next_jobs' => in_array('user_shifts', $privileges) ? block(array('title' => _("My next jobs"), 'body' => getUsersNextJobs($shifts, 3 * 60 * 60)), BLOCK_TYPE_PANEL) : '', 'jobs_currently_running' => block(array('title' => _("Currently running"), 'body' => getListCurrentShifts($shifts)), BLOCK_TYPE_PANEL), 'jobs_now' => block(array('title' => _("Within the next hour"), 'body' => getListUpcomingShifts($shifts, 60 * 60)), BLOCK_TYPE_PANEL), 'jobs_soon' => block(array('title' => _("Within the next 3 hours"), 'body' => getListUpcomingShifts($shifts, 3 * 60 * 60)), BLOCK_TYPE_PANEL), 'news' => block(array('title' => _("News"), 'body' => getAllNewsList()), BLOCK_TYPE_PANEL), 'api_shifts_link' => api_link('shifts'));
    return dashboardView($viewData);
}
Пример #2
0
function content()
{
    // acquire variables
    $g_search = $_GET['q'];
    // show filters
    echo $GLOBALS['navigation']->filtersText();
    // build table
    $trainings_table = new str_table(api_text("module-diary_list-tr-unvalued"), TRUE, $GLOBALS['navigation']->filtersGet());
    $trainings_table->addHeader(" ", NULL, "16");
    $trainings_table->addHeader(api_text("module-diary_list-th-sport"), "nowarp", NULL, "`module-diary_trainings`.`sport`");
    $trainings_table->addHeader(api_text("module-diary_list-th-sort"), "nowarp", NULL, "`module-diary_trainings`.`sort`");
    $trainings_table->addHeader(api_text("module-diary_list-th-time"), "nowarp", NULL, "`module-diary_trainings`.`time`");
    $trainings_table->addHeader(api_text("module-diary_list-th-distance"), "nowarp", NULL, "`module-diary_trainings`.`distance`");
    $trainings_table->addHeader(api_text("module-diary_list-th-datetraining"), "nowarp", NULL, "`module-diary_trainings`.`datetraining`");
    $trainings_table->addHeader(api_text("module-diary_list-th-description"), NULL, "40%");
    // get trainings
    $trainings = api_moduleDiary_trainings($g_search, TRUE);
    foreach ($trainings->results as $training) {
        // check selected
        if ($training->id == $_GET['idTraining']) {
            $tr_class = "info";
        } else {
            $tr_class = NULL;
        }
        // build address table row
        $trainings_table->addRow($tr_class);
        // build table fields
        $trainings_table->addField(api_link("module-diary_view.php?idTraining=" . $training->id, api_icon("icon-search", api_text("module-diary_list-td-view"))), "nowarp");
        $trainings_table->addField($training->sportText, "nowarp");
        $trainings_table->addField($training->sortText, "nowarp");
        $trainings_table->addField($training->time, "nowarp");
        $trainings_table->addField($training->distance, "nowarp");
        /**
        * Timestamp Format
        * @param string $timestamp MySql datetime
        * @param string $format datetime format ( php date format or language key )
        * @param string $language language conversion
        * @return string formatted date time
        */
        //function api_timestampFormat($timestamp,$format="Y-m-d H:i:s",$language=NULL){
        //$trainings_table->addField(api_timestampFormat($training->datetraining,"D-d-M-y"));
        $training->datetraining = strtotime($training->datetraining);
        $giorno = date('D-d-M-y', $training->datetraining);
        $trainings_table->addField($giorno);
        //$trainings_table->addField($training->datetraining);
        $trainings_table->addField($training->description, "nowarp");
    }
    // show table
    $trainings_table->render();
    // renderize the pagination
    $trainings->pagination->render();
    // debug
    if ($_SESSION["account"]->debug) {
        pre_var_dump($trainings->query, "print", "query");
        pre_var_dump($trainings->results, "print", "trainings");
    }
}
Пример #3
0
function append_global_styles_site_header($params)
{
    //print '';
    $template_name = $params;
    $template_name = str_replace('..', '', $template_name);
    $url = api_link('user_styles_css/?template_name=' . $template_name);
    $src = '<link rel="stylesheet" id="mw-user-stylesheet" href="' . $url . '" type="text/css" media="all">' . "\n";
    template_head($src);
}
Пример #4
0
isCreating = false;


function mw_create_new_list_<?php 
print $rand;
?>
(){
  if(!isCreating){

      isCreating = true;
	  mw.form.post('.mw_create_new_forms_list<?php 
print $rand;
?>
', '<?php 
print api_link('save_form_list');
?>
', function(){



        mw.reload_module('<?php 
print $config['module'];
?>
', function(){
          isCreating = false;
        });
    }

      );
   }
Пример #5
0
            mw.$("#user-section-title").html(userSections.edit);
            mw.$("#add-new-user-btn").hide();
        }

    });


    function mw_admin_delete_user_by_id(id) {
        mw.tools.confirm("<?php 
_e("Are you sure you want to delete this user?");
?>
", function () {
            data = {};
            data.id = id
            $.post("<?php 
print api_link();
?>
delete_user", data, function () {
                _mw_admin_users_manage();
            });
        });
    }

</script>
    <?php 
$mw_notif = url_param('mw_notif');
if ($mw_notif != false) {
    $mw_notif = mw()->notifications_manager->read($mw_notif);
}
mw()->notifications_manager->mark_as_read('users');
?>
Пример #6
0
if (get_option('disable_captcha', $params['id']) != 'y') {
    ?>
                    <label class="custom-field-title"><?php 
    _e("Enter Security code");
    ?>
</label>
                    <div class="mw-ui-row captcha-holder">
                        <div class="mw-ui-col">
                            <input name="captcha" type="text" required class="mw-captcha-input"/>
                        </div>
                        <div class="mw-ui-col">
                          <img onclick="mw.tools.refresh_image(this);" class="mw-captcha-img" id="captcha-<?php 
    print $form_id;
    ?>
" src="<?php 
    print api_link('captcha');
    ?>
?id=<?php 
    print $params['id'];
    ?>
" />
                        </div>
                        <div class="mw-ui-col">
                           <span class="ico irefresh" onclick="mw.tools.refresh_image(mwd.getElementById('captcha-<?php 
    print $form_id;
    ?>
'));"></span>
                        </div>
                    </div>
                    <input type="submit" class="mw-ui-btn pull-right" style="margin-left: 12px;"  value="<?php 
    _e("Send Message");
Пример #7
0
?>
</em></li>
      <li>
        <?php 
_e("In");
?>
        <em>
        <?php 
_e("Callback URL");
?>
        </em>
        <?php 
_e("enter");
?>
        <em><?php 
print api_link('social_login_process?provider=linkedin');
?>
</em></li>
    </ol>
    <label class="mw-ui-label">
      <?php 
_e("Client ID");
?>
    </label>
    <input name="linkedin_app_id" class="mw_option_field mw-ui-field mw-title-field" style=""   type="text" option-group="users"  value="<?php 
print get_option('linkedin_app_id', 'users');
?>
" />
    <label class="mw-ui-label">
      <?php 
_e("Client Secret");
Пример #8
0
<script type="text/javascript">




  


 function save_sysconf_form(){


 mw.form.post('#sysconfig-form-<?php 
print $params['id'];
?>
', '<?php 
print api_link('mw_save_framework_config_file');
?>
',
			function(msg) {
mw.notification.msg(this);
 return false;
			});
            return false;

 }


</script>

Internal settings
<div class="mw_clear"></div>
Пример #9
0
</script>
<script type="text/javascript">



mw.client_edit = {
   enable:function(e){
     mw.$('.mw-client-information').removeClass('nonactive');
     mw.$('.mw-client-information input').eq(0).focus();
   },
   disable:function(){
      mw.$('.mw-client-information').addClass('nonactive');
   },
   save:function(){
        var URL = '<?php 
    print api_link('shop/update_order');
    ?>
';
        if(!mw.$('.mw-client-information').hasClass('nonactive')){
           var obj = mw.form.serialize('.mw-client-information');
           $.post(URL, obj ,function(data) {
            mw.reload_module('<?php 
    print $config['module'];
    ?>
');
          });
        }
    }
}

Пример #10
0
        :
        <?php 
            if (isset($cur_user_data['thumbnail']) and trim($cur_user_data['thumbnail']) != '') {
                ?>
        <span class="mw-user-thumb mw-user-thumb-small"> <img style="vertical-align:middle" src="<?php 
                print $cur_user_data['thumbnail'];
                ?>
"  height="24" width="24" /> </span>
        <?php 
            }
            ?>
        <span class="comments-user-profile-username"> <?php 
            print user_name($cur_user_data['id']);
            ?>
 </span> <small><a href="<?php 
            print api_link('logout');
            ?>
">(
        <?php 
            _e("Logout");
            ?>
        )</a></small> </span>
        <?php 
        }
        ?>
        <div class="row comment-textarea">
          <div class="col-sm-12  comment-field">
            <textarea required placeholder="<?php 
        _e("Comment");
        ?>
" name="comment_body" class="form-control input-lg"></textarea>
Пример #11
0
<script type="text/javascript">




  


 function save_sysconf_form(){


 mw.form.post('#sysconfig-form-<?php 
print $params['id'];
?>
', '<?php 
print api_link('Adapters/save_config');
?>
',
			function(msg) {
mw.notification.msg(this);
 return false;
			});
            return false;

 }


</script>

Internal settings
<div class="mw_clear"></div>
Пример #12
0
		  }
          var _new = master.parentNode.querySelector('.new-comments');
          var _old = master.parentNode.querySelector('.old-comments');
          if($(_new).is(":visible") || $(_old).is(":visible")){
               $([_new, _old]).hide();
               $(master).removeClass("active");
          }
          else{
              $([_new, _old]).show();
              $(master).addClass("active");
				var  is_cont = $(master).attr('content-id')
				if(typeof is_cont != "undefined"){
					var mark_as_old = {}
					mark_as_old.content_id = is_cont;
					$.post('<?php 
print api_link('mark_comments_as_old');
?>
', mark_as_old, function(data) {

					});
				}
         }
      }
    }
</script>
<?php 
$mw_notif = url_param('mw_notif');
if ($mw_notif != false) {
    $mw_notif = mw()->notifications_manager->read($mw_notif);
}
mw()->notifications_manager->mark_as_read('comments');
Пример #13
0
!!!!!!\n<?php 
_e("ALL ORDERS FROM THIS CLIENT WILL BE DELETED");
?>
!\n\n<?php 
_e("CLICK CANCEL NOW");
?>
\n<?php 
_e("OR");
?>
\n<?php 
_e("THERE IS NO TURNING BACK");
?>
!")
if (r1==true){
	 $.post("<?php 
print api_link('delete_client');
?>
", { email: $email } ,function(data) {
		mw.reload_module('shop/orders/clients');
	});
  }
   }
}

</script>

<script>

$(window).bind('load', function () {
	
Пример #14
0
', '<?php 
print api_link('mw_composer_save_package');
?>
',
            function (msg) {


                mw.notification.msg(this);
                reload_changes();
                return false;
            });
        return false;
    }
    function remove_patch_item($key) {
        $.post("<?php 
print api_link('mw_composer_save_package');
?>
", { require_name: $key, require_version: "delete" })
            .done(function (msg) {
                // mw.notification.msg(this);
                reload_changes();
            });

    }
    function reload_changes() {
        mw.reload_module('#<?php 
print $params['id'];
?>
');

    }
Пример #15
0
print api_link('Notifications/reset');
?>
", function(){
		 	mw.reload_module('admin/notifications');
									//	mw.reload_module('#<?php 
print $params['id'];
?>
');

	  });
}


mw.notif_mark_all_as_read = function(){
	 $.get("<?php 
print api_link('Notifications/mark_all_as_read');
?>
", function(){
		 	mw.reload_module('admin/notifications');
									//	mw.reload_module('#<?php 
print $params['id'];
?>
');

	  });
}


</script>
<?php 
if (is_array($data)) {
Пример #16
0
        },
        scroll: false
    });

    $("#pages_tree_toolbar .pages_tree .have_category").sortable({
        axis: 'y',
        items: '.category_element',
        distance: 35,
        update: function () {
            var obj = {ids: []}
            mw.$('.category_element', this).each(function () {
                var id = this.attributes['data-category-id'].nodeValue;
                obj.ids.push(id);
            });
            $.post("<?php 
print api_link('category/reorder');
?>
", obj, function () {
                mw.reload_module('#mw_page_layout_preview');
            });
        },
        start: function (a, ui) {

        },
        scroll: false
    });
}


</script>
 
Пример #17
0

 return false;

 }



 function save_lang_form(){


 mw.form.post('#language-form-<?php 
print $params['id'];
?>
', '<?php 
print api_link('save_language_file_content');
?>
',
			function(msg) {
mw.notification.msg(this);

			});
            return false;

 }


</script>
<style>
    .send-your-lang{
      float: right;
Пример #18
0
?>
</em></li>
      <li>
        <?php 
_e("In");
?>
        <em>
        <?php 
_e("Callback URL");
?>
        </em>
        <?php 
_e("enter");
?>
        <em><?php 
print api_link('social_login_process?provider=twitter');
?>
</em></li>
    </ol>
    <label class="mw-ui-label">
      <?php 
_e("Consumer key");
?>
    </label>
    <input name="twitter_app_id" class="mw_option_field mw-ui-field mw-title-field" style=""   type="text" option-group="users"  value="<?php 
print get_option('twitter_app_id', 'users');
?>
" />
    <label class="mw-ui-label">
      <?php 
_e("Consumer secret");
Пример #19
0
print $form_rand_id;
?>
').submit(function() {
	     var form = this;
		 if(mw.category_is_saving){
			 return false;
		 }
		 mw.notification.success("Saving...",3000);
		 mw.category_is_saving = true;
		 $('.mw-cat-save-submit').addClass('disabled');
         mw.tools.addClass(mw.tools.firstParentWithClass(this, 'module'), 'loading');
         mw.form.post(mw.$('#admin_edit_category_form_<?php 
print $form_rand_id;
?>
') , '<?php 
print api_link('category/save');
?>
', function(val){
			 
			 
			 if(typeof(this.error) != "undefined"){
				  mw.notification.msg(this);
				   mw.category_is_saving = false;
				  return false;
			 }
			 
			 
			 
            mw.$('#mw-notifications-holder').empty();
        	  mw.notification.success("Category changes are saved");
 			  var v = this.toString();
Пример #20
0
print api_link('notifications_manager/reset');
?>
", function(){
		 	mw.reload_module('admin/notifications');
									//	mw.reload_module('#<?php 
print $params['id'];
?>
');

	  });
}


mw.notif_mark_all_as_read = function(){
	 $.get("<?php 
print api_link('notifications_manager/mark_all_as_read');
?>
", function(){
		 	mw.reload_module('admin/notifications');
									//	mw.reload_module('#<?php 
print $params['id'];
?>
');

	  });
}


</script>
<?php 
if (is_array($data)) {
Пример #21
0
   menuSelectorInit();


});



 </script>
<script  type="text/javascript">
    if(typeof mw.menu_save_new_item !== 'function'){
        mw.menu_save_new_item = function(selector,no_reload){



        	mw.form.post(selector, '<?php 
print api_link('content/menu_item_save');
?>
', function(){

				mw.$('#<?php 
print $params['id'];
?>
').removeAttr('new-menu-id');
				if(no_reload === undefined){
        		mw.reload_module('menu/edit_items');
				}
				
				 

        		if(self!==parent && typeof parent.mw === 'object'){
        			parent.mw.reload_module('menu');
Пример #22
0
        <?php 
    if ($google) {
        ?>
        <li><a href="<?php 
        print api_link('user_social_login?provider=google');
        ?>
" class="mw-signin-with-google">Google login</a></li>
        <?php 
    }
    ?>

        <?php 
    if ($github) {
        ?>
        <li><a href="<?php 
        print api_link('user_social_login?provider=github');
        ?>
" class="mw-signin-with-github">Github login</a></li>
        <?php 
    }
    ?>
    <?php 
    if ($have_social_login) {
        ?>
</ul><?php 
    }
    ?>

    </div>

    <input class="btn pull-right" type="submit" value="<?php 
Пример #23
0
         $(this).find('.menu_element').each(function(){
            var id = this.attributes['data-item-id'].nodeValue;
            obj.ids.push(id);
			var $has_p =  $(this).parents('.menu_element:first').attr('data-item-id');
			if($has_p != undefined){
			  obj.ids_parents[id] = $has_p;
			}
            else {
				var $has_p1 =  $('#ed_menu_holder').find('[name="parent_id"]').first().val();
    			if($has_p1 != undefined){
    			 	obj.ids_parents[id] =$has_p1;
    			}
			}
         });
         $.post("<?php 
    print api_link('content/menu_items_reorder');
    ?>
", obj,function(msg){
			 
			 	 if(mw.notification != undefined){
			 mw.notification.success('Menu changes are saved');
			 }
 			mw.menu_item_after_save();

			 });

       },
       start:function(a,ui){
              $(this).height($(this).outerHeight());
              $(ui.placeholder).height($(ui.item).outerHeight())
              $(ui.placeholder).width($(ui.item).outerWidth())
Пример #24
0
</a> <a href="<?php 
    print api_link('logout');
    ?>
" >
      <?php 
    _e("Log Out");
    ?>
      </a>
      <?php 
} else {
    ?>
      <form autocomplete="on" method="post" id="user_login_<?php 
    print $params['id'];
    ?>
"  action="<?php 
    print api_link('user_login');
    ?>
"  >
        <div class="mw-ui-field-holder">
          <input  class="mw-ui-field mw-ui-field-big" autofocus="" tabindex="1" required  name="username" type="text" placeholder="<?php 
    _e("Username or Email");
    ?>
" <?php 
    if (isset($_REQUEST['username']) != false) {
        ?>
 value="<?php 
        print $_REQUEST['username'];
        ?>
"  <?php 
    }
    ?>
Пример #25
0
}

mw.manage_content_sort = function(){
  if(!mw.$("#mw_admin_posts_sortable").hasClass("ui-sortable")){
        mw.$("#mw_admin_posts_sortable").sortable({
             items: '.manage-post-item',
             axis:1,
             handle:'.mw_admin_posts_sortable_handle',
             update:function(){
               var obj = {ids:[]}
               $(this).find('.select_posts_for_action').each(function(){
                var id = this.attributes['value'].nodeValue;
                obj.ids.push(id);
              });
              $.post("<?php 
print api_link('content/reorder');
?>
", obj, function(){
        		   mw.reload_module('#mw_page_layout_preview');
				   mw.reload_module_parent('posts');
				   mw.reload_module_parent('content');
				   mw.reload_module_parent('shop/products');
        	  });
             },
             start:function(a,ui){
              $(this).height($(this).outerHeight());
              $(ui.placeholder).height($(ui.item).outerHeight())
              $(ui.placeholder).width($(ui.item).outerWidth())
            },
            scroll:false
        });
Пример #26
0
				 });
		  });
	} 
}


SaveAdminUserForm<?php 
    print $data['id'];
    ?>
 = function(){
    if(mwd.getElementById("reset_password").value == ''){
        mwd.getElementById("reset_password").disabled = true;
    }
    mw.tools.loading('.mw-module-admin-wrap');
    mw.form.post(mw.$('#users_edit_{rand}') , '<?php 
    print api_link('save_user');
    ?>
', function(){
      UserId = this;
      mw.tools.loading('.mw-module-admin-wrap', false);
	  mw.reload_module('[data-type="users/manage"]', function(){
	    mw.hash('#sortby=created_at desc');
        mw.notification.success('<?php 
    _e("All changes saved");
    ?>
');
        setTimeout(function(){
            mw.tools.highlight(mwd.getElementById('mw-admin-user-'+UserId));
        }, 300);
	  });
	 });
Пример #27
0
description: Default cart template
*/
if ($requires_registration and is_logged() == false) {
    ?>
<module type="users/register" />
<?php 
} else {
    if ($payment_success == false) {
        ?>

<form class="mw-checkout-form" id="checkout_form_<?php 
        print $params['id'];
        ?>
" method="post"
          action="<?php 
        print api_link('checkout');
        ?>
">
  <?php 
        $cart_show_enanbled = get_option('data-show-cart', $params['id']);
        ?>
  <?php 
        if ($cart_show_enanbled != 'n') {
            ?>
  <br />
  <module type="shop/cart" template="big" id="cart_checkout_<?php 
            print $params['id'];
            ?>
"
                    data-checkout-link-enabled="n"/>
  <?php 
Пример #28
0
	} else {
		 log_del_conf++;
    	  $.get("<?php 
print api_link('delete_log_entry');
?>
/"+$item_id, function(){
    		 	mw.$('.mw-ui-admin-log-item-'+$item_id).fadeOut();
    	  });
	}

}

mw.syslog_log_reset_all = function(){
	 mw.tools.confirm("All the log entries will be deleted!! Are you sure?", function(){
	 $.get("<?php 
print api_link('system_log_reset');
?>
", function(){
		 	mw.reload_module('<?php 
print $config['module'];
?>
');
	  });
	 });
}


</script>
<?php 
if (is_array($data)) {
    ?>
Пример #29
0
            mw.$('form#comments-form-<?php 
    print $params['id'];
    ?>
').submit(function () {

                if (mw.comments_is_saving == true) {
                    return false;
                }

                mw.comments_is_saving = true;
                mw.form.post('form#comments-form-<?php 
    print $params['id'];
    ?>
', '<?php 
    print api_link('post_comment');
    ?>
',
                    function (msg) {
                        mw.comments_is_saving = false;
                        var resp = this;
                        var data2 = (resp);
                        if (typeof(data2.error) != 'undefined') {
                            mw.response(mw.$('form#comments-form-<?php 
    print $params['id'];
    ?>
'), data2);
                        }
                        if (typeof(resp.error) != 'undefined') {
                            var err_hold = "error-comments-form-<?php 
    print $params['id'];
Пример #30
0
/*if(isset($params['is_read'])){
	$notif_params["is_read"] = $params['is_read'];
}
if(isset($params['limit'])){
	$notif_params["is_read"] = $params['is_read'];
}*/
$notif_params["order_by"] = 'created_at desc';
$notif_params["order_by"] = 'is_read desc, created_at desc';
$data = mw()->notifications_manager->get($notif_params);
?>
<script  type="text/javascript">
mw.notif_item_delete = function($item_id){


	 $.get("<?php 
print api_link('mw/Notifications/delete');
?>
/"+$item_id, function(){
		 	mw.$('.mw-ui-admin-notif-item-'+$item_id).fadeOut();

	  });
}
</script>
<?php 
if (is_array($data)) {
    ?>




<div class="mw-admin-notifications-holder">