Code Monkey home page Code Monkey logo

oxid-formedit's Introduction

Oxid formedit (beta)

Description

Build your admin views with drag and drop.

Module was created for Oxid 6.x

IDE

Results

Install

  1. Copy files into following directory

     source/modules/rs/formedit
    
  2. Add to composer.json at shop root

     "autoload": {
         "psr-4": {
             "rs\\formedit\\": "./source/modules/rs/formedit"
         }
     },
    
  3. Install dependencies

     composer require mustangostang/spyc --no-update
     composer update --no-plugins --no-scripts --no-dev --ignore-platform-reqs
    
  4. Refresh autoloader files with composer in the oxid root directory.

     composer dump-autoload
    
  5. Modifications

Modify following file:

out/admin/src/oxid.js

Search for function changeEditBar. Copy following snippet on the top of the function.

/* cpformedit start */
var input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("name", "rs_formedit_sPos");
input.setAttribute("value", sPos);
top.basefrm.edit.document.getElementById( "transfer" ).appendChild(input);

var sNode="";
var aInput = top.basefrm.list.document.getElementById( "search" ).getElementsByTagName('input');
if(aInput && aInput.length > 0)
{
    for(x=0;x<aInput.length;x++)
    {
        if(aInput[x].name=="cl")
        {
            sNode=aInput[x].value;
        }
    }
}
var input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("name", "rs_formedit_sNode");
input.setAttribute("value", sNode);
top.basefrm.edit.document.getElementById( "transfer" ).appendChild(input);
/* cpformedit end */
  1. Security

Please add a .htaccess/.htpasswd to the oxid admin and copy the .htaccess to the folder:

rs/formedit/formedit

to prevent access the backend views from outside of the oxid admin area.

How to use

You can add formedit projects to all modules from this shop. Create a folder

formeditprojects

within the modules.

You can extend the menu.xml of the module to call the project.

Example "menu.xml"

<?xml version="1.0" encoding="ISO-8859-15"?>
<OX>
    <OXMENU id="NAVIGATION_ESHOPADMIN">
        <MAINMENU id="mxmanageprod">
            <SUBMENU id="mxarticles" cl="article" list="article_list">
                <!--
                attribute
                cl = rs_formedit_halfpage|rs_formedit_fullpage|rs_formedit_fullpage_lang
                    rs_formedit_halfpage = like the bottom part of the article view
                    rs_formedit_fullpage = a fullpage view
                    rs_formedit_fullpage_lang = a fullpage view with language select box
                clparam = combination from parameters seprated with &amp;
                    parameter:
                    project=path within the module folder to the projectfile (example: project=cpoxshop/cpformedit/oxshop.cpf)
                    optional: navi= in which mode should the formeid start. values=NEW|EDIT. default=NEW
                    optional: index1value=unique identifier what should load at the beginning. if you want load data directly (parameter navi must set to EDIT) Only on cpformedit_fullpage|cpformedit_fullpage_lang
                    optional: useindex=index1value|index2value. Default: index1. Normally in a tab the oxid from a article,user... is set into the index1value parameter, but if you like to build a n:m relation it have to start with index2value. navi have to set to NEW. Only on cpformedit_halfpage
                -->
                <TAB id="tbclcpformedit_article" cl="rs_formedit_halfpage" clparam="project=MODULEFOLDER/cpformedit/oxarticles.cpf" />
            </SUBMENU>
        </MAINMENU>
    </OXMENU>
</OX>

Other featues

  • You can extend the formedit views by php files to implement new validations
  • You can develop your own controls for easy reuse
  • ...

oxid-formedit's People

Contributors

thomasjanda avatar

Watchers

 avatar  avatar

Forkers

oligoform

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.