close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Framework's Load plugin to div

Thread began 3/08/2023 7:29 am by asarcona308398 | Last modified 3/13/2023 3:19 pm by Ray Borduin | 226 views | 6 replies |

asarcona308398

Framework's Load plugin to div

I'm trying to create a dashboard on the admin side of things and I'm using Framework Builder's Load Plugin to DIV to populate the main <div> on the right side of the page... all is good and works exceptionally well when just maneuvering about all the plugged in pages... only thing I'm stumped on is, if I load an UPDATE or INSERT page into the main <div> as a plugin, when the UPDATE/INSERT is finished it will redirect to let's say the details page if an insert or update is done. I would like to be able to stay on that plugged in page where the data is being updated or inserted, and then by way of a link/button plugin to go back to the main <div> after update/insert... OR be able to be able to adjust the $InsertGoTo = "../dashboard.php#maindiv"; to go to the main <div>.
I am using ---
action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != ""?"?".htmlentities($_SERVER["QUERY_STRING"], ENT_QUOTES):""); ?>"
in the form action"" and the UPDATE or INSERT works .
I've tried to add the ---
onClick="framework_load_plugin_url('plugins/productcategories_results.php',false,'main','../','');return document.MM_returnValue"
to the INSERT/UPDATE button but the javascript doesn't let the page submit the form to the server first...

Has anyone found a way to make something like this work?

Tony


UPDATE

this is the $SERVER info:

Array
(
[MIBDIRS] => C:/xampp1/php/extras/mibs
[MYSQL_HOME] => \xampp\mysql\bin
[OPENSSL_CONF] => C:/xampp1/apache/bin/openssl.cnf
[PHP_PEAR_SYSCONF_DIR] => \xampp\php
[PHPRC] => \xampp\php
[TMP] => \xampp\tmp
[HTTP_HOST] => localhost
[HTTP_CONNECTION] => keep-alive
[HTTP_SEC_CH_UA] => "Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110"
[HTTP_SEC_CH_UA_MOBILE] => ?0
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
[HTTP_SEC_CH_UA_PLATFORM] => "Windows"
[HTTP_ACCEPT] => */*
[HTTP_SEC_FETCH_SITE] => same-origin
[HTTP_SEC_FETCH_MODE] => cors
[HTTP_SEC_FETCH_DEST] => empty
[HTTP_REFERER] => http://localhost/Bootstrap/admin/dashboard.php
[HTTP_ACCEPT_ENCODING] => gzip, deflate, br
[HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.9
[HTTP_COOKIE] => PHPSESSID=is82r73s1d34ajgtsef8as35lp; SHOPNO=1; WAFC_MENU_DEV_OPENCLOSE=todayDate%3D%7C%3F2minutes%3D%7C%3Fday%3D; TODAYDATE=2023-03-09; TODAYDAY=5; TIMENOW=08%3A49%3A32
[PATH] => C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Users\asarc\AppData\Local\Microsoft\WindowsApps
[SystemRoot] => C:\WINDOWS
[COMSPEC] => C:\WINDOWS\system32\cmd.exe
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
[WINDIR] => C:\WINDOWS
[SERVER_SIGNATURE] =>
Apache/2.4.54 (Win64) OpenSSL/1.1.1p PHP/8.1.12 Server at localhost Port 80


[SERVER_SOFTWARE] => Apache/2.4.54 (Win64) OpenSSL/1.1.1p PHP/8.1.12
[SERVER_NAME] => localhost
[SERVER_ADDR] => ::1
[SERVER_PORT] => 80
[REMOTE_ADDR] => ::1
[DOCUMENT_ROOT] => C:/xampp1/htdocs
[REQUEST_SCHEME] => http
[CONTEXT_PREFIX] =>
[CONTEXT_DOCUMENT_ROOT] => C:/xampp1/htdocs
[SERVER_ADMIN] => postmaster@localhost
[SCRIPT_FILENAME] => C:/xampp1/htdocs/Bootstrap/webassist/framework/ajax_wrapper.php
[REMOTE_PORT] => 59676
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] => plugin_from=localhost/Bootstrap/admin/dashboard.php&plugin_file=Y2F0YWxvZy9wcm9kdWN0Y2F0ZWdvcmllc19pbnNlcnQucGhw
[REQUEST_URI] => /Bootstrap/webassist/framework/ajax_wrapper.php?plugin_from=localhost/Bootstrap/admin/dashboard.php&plugin_file=Y2F0YWxvZy9wcm9kdWN0Y2F0ZWdvcmllc19pbnNlcnQucGhw
[SCRIPT_NAME] => /Bootstrap/webassist/framework/ajax_wrapper.php
[PHP_SELF] => /Bootstrap/webassist/framework/ajax_wrapper.php
[REQUEST_TIME_FLOAT] => 1678384914.5749
[REQUEST_TIME] => 1678384914
)

It has the [REQUEST_URI] as:
[REQUEST_URI] => /Bootstrap/webassist/framework/ajax_wrapper.php?plugin_from=localhost/Bootstrap/admin/dashboard.php&plugin_file=Y2F0YWxvZy9wcm9kdWN0Y2F0ZWdvcmllc19pbnNlcnQucGhw

is this for a static plugin?

Attached Files
dashboard.zip
productcategories_insert.zip
Sign in to reply to this post

Ray BorduinWebAssist

I'm sure it is possible, but This is probably too complex for a forum answer. I''m sure I can help you figure it out in a premier support ticket. I'd do an hour of screen sharing and you could walk me through your application and I'd figure out how to get what you want done. Just post your phone number in the private area of a reply to this thread and I'll give you a call and schedule an hour screen share with you.

Sign in to reply to this post
Did this help? Tips are appreciated...

asarcona308398

See PM ...

Sign in to reply to this post

Ray BorduinWebAssist

I'm winding down for the day and I'm flying home tomorrow. This might have to wait until Monday afternoon (my last doctors appointment ends at 4pm my time). Sorry for the inconvenience.

Sign in to reply to this post
Did this help? Tips are appreciated...

asarcona308398

Hey Ray...PM

Sign in to reply to this post

asarcona308398

Hey Ray..

I think I may have solved the redirect back to the Dashboard....sort of...

I am setting a session variable of -- $_SESSION[ 'pageID' ] on the plugged-in page, lets say an Insert to DB page for example, then configuring the $InsertGoTo = "../dashboard.php"; to go back to the dashboard, then on the dashboard page the <body> element is in an 'if' statement as such:

<?php

if ((isset( $_SESSION[ 'pageID' ])) == "productcategories_insert.php" ) {

echo "<body onLoad="."framework_load_plugin_url('plugins/catalog/productcategories_results.php',false,'main','../','');return document.MM_returnValue".">";

} else {


echo "<body onLoad="."framework_load_plugin_url('plugins/DashboardMain.php',false,'main','../',false,dashboard);return document.MM_returnValue".">";

}

?>

the 'if' statement would load the default dashboard <div> if the plugin page's session variable is not set.

on the dashboard page I start the session at the top of the page as usual... but then clear the plugin page's set session variable at the bottom of the page.. seems to be working.


Then if I refresh the dashboard page the session variable that is no longer available, defaults to the DashboardMain plugin.

Not sure if this is best method, but it does work.

This would also have to be done with the $UpdateGoTo , as well as the $DeleteGoTo covering ALL the re-directs.

Let me know if I'm on the right track, and when you have time and are feeling up to it I would still be up for that session.

Hope you are doing well with your treatments.

All the Best,

Tony



====================
====== UPDATE ======
====================

dashboard.php modifications that work!!

<?php
@session_start();
?>
... at top of page


After putting a switch/case in the dashboard.php file as such...


<?php

$page = ((isset( $_SESSION[ 'pageID' ])) ? $_SESSION['pageID'] : "");

switch ($page) {

case "productcategories_insert.php":
echo "<body onLoad="."framework_load_plugin_url('plugins/catalog/productcategories_results.php',false,'main','../','');return document.MM_returnValue".">";

case "productcategories_update.php":
echo "<body onLoad="."framework_load_plugin_url('plugins/catalog/productcategories_results.php',false,'main','../','');return document.MM_returnValue".">";

case "productcategories_details.php":
echo "<body onLoad="."framework_load_plugin_url('plugins/catalog/productcategories_results.php',false,'main','../','');return document.MM_returnValue".">";

case "productcategories_results.php":
echo "<body onLoad="."framework_load_plugin_url('plugins/catalog/productcategories_results.php',false,'main','../','');return document.MM_returnValue".">";

default: echo "<body onLoad="."framework_load_plugin_url('plugins/DashboardMain.php',false,'main','../',false,dashboard);return document.MM_returnValue".">";

}
?>

..and at the bottom:

<?php
@session_start();
if (true){
// WA_ClearSession
$clearAll = FALSE;
$clearThese = explode(",","pageID");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>

and then on all DataAssist pages ...


$SESSION variableon all DataAssist pages corresponding to it's name:

<?php
@session_start();
if(!isset($_SESSION["pageID"])) {
$_SESSION["pageID"] = "productcategories_detail.php";
}
?>
for productcategories_detail.php...

<?php
@session_start();
if(!isset($_SESSION["pageID"])) {
$_SESSION["pageID"] = "productcategories_insert.php";
}
?>
for productcategories_insert.php...

<?php
@session_start();
if(!isset($_SESSION["pageID"])) {
$_SESSION["pageID"] = "productcategories_results.php";
}
?>
for productcategories_results.php...


<?php
@session_start();
if(!isset($_SESSION["pageID"])) {
$_SESSION["pageID"] = "productcategories_update.php";
}
?>
for productcategories_update.php...



$InsertGoTo = "../dashboard.php"; -- on ***_insert.php

$UpdateGoTo = "../dashboard.php"; -- on ***_update.php

$DeleteGoTo = "../dashboard.php"; -- on ***_detail.php, and on ***_results.php ... wherever I had a Delete button!

Ray if you have an idea for a better implementation let me know...

Tony

Sign in to reply to this post

Ray BorduinWebAssist

I'm glad you got it figured out! I'd have to really spend time and understand your application to know if I have a better solution, so I'd say if it works and you are happy with the speed and user experience, then it's a perfect solution.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...