Tentando commitar o mind
@@ -0,0 +1,26 @@
|
||||
# Instalation
|
||||
|
||||
TheWebMind's core was developed in PHP. Then, it's needed to have a working PHP environment configured in your machine or server, wherever you prefer to configura Mind.
|
||||
First, download the project's content. Go to the download center to acquire the latest version, at: http://thewebmind.org/.
|
||||
|
||||
# Requirements
|
||||
|
||||
To run TheWebMind you need:
|
||||
|
||||
* PHP 5 or superior
|
||||
* HTTP Server (We recomend Apache)
|
||||
* A modern Browser*
|
||||
* Javascript on
|
||||
|
||||
# To Linux users: TheWebMind needs to create and modify files and directories into its folder.
|
||||
Be sure that the HTTP user (usualy www-data or apache) has access to read, write and execute, into it.
|
||||
|
||||
# After downloading theWebMind, unzip it into your server.
|
||||
It's enough to have it working, and you can access it just hitting its address.
|
||||
For example: http://localhost/thewebmind
|
||||
Any difficulties, visit our FAQ.
|
||||
|
||||
|
||||
http://thewebmind.org
|
||||
http://docs.thewebmind.org
|
||||
contact@thewebmind.org
|
||||
@@ -0,0 +1,24 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2010 TheWebMind.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,5 @@
|
||||
See INSTALL.txt file to help.
|
||||
|
||||
http://thewebmind.org
|
||||
http://docs.thewebmind.org
|
||||
contact@thewebmind.org
|
||||
|
Depois Largura: | Altura: | Tamanho: 12 KiB |
|
Depois Largura: | Altura: | Tamanho: 4.3 KiB |
|
Depois Largura: | Altura: | Tamanho: 4.8 KiB |
|
Depois Largura: | Altura: | Tamanho: 5.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.2 KiB |
|
Depois Largura: | Altura: | Tamanho: 7.0 KiB |
|
Depois Largura: | Altura: | Tamanho: 85 KiB |
|
Depois Largura: | Altura: | Tamanho: 63 KiB |
|
Depois Largura: | Altura: | Tamanho: 12 KiB |
|
Depois Largura: | Altura: | Tamanho: 30 KiB |
|
Depois Largura: | Altura: | Tamanho: 4.3 KiB |
|
Depois Largura: | Altura: | Tamanho: 5.4 KiB |
@@ -0,0 +1,484 @@
|
||||
<?php
|
||||
include('restrict/config/mind.php');
|
||||
include('restrict/'.$_MIND['framework']);
|
||||
|
||||
$_MIND['rootDir']= 'restrict/'.$_MIND['rootDir'];
|
||||
|
||||
if(sizeof(($users= @$_MIND['fw']->getUsersList())) == 0)
|
||||
{
|
||||
$u= new User();
|
||||
$u->name('Administrator');
|
||||
$u->login('admin');
|
||||
$u->pwd('admin');
|
||||
$u->position('admin');
|
||||
$u->status(1);
|
||||
$u->email('contato@thewebmind.org');
|
||||
|
||||
if($u->save())
|
||||
{
|
||||
$info= "<table style='width:100%;
|
||||
color:#444;
|
||||
background-color:#eec;
|
||||
border-bottom:solid 2px #669;
|
||||
padding: 7px;
|
||||
text-align:justify;
|
||||
position:absolute;
|
||||
top:0px;
|
||||
height:100px;
|
||||
bottom:0px;'
|
||||
id='selfDestroyDiv'
|
||||
align='center'>
|
||||
<tr>
|
||||
<td>
|
||||
<img src='images/tip.png'>
|
||||
</td>
|
||||
<td>
|
||||
Oh! I see this is your first time around here.<br/>To you to start working with the system, the user <b><i>admin</i></b> has been created, with the password <b><i>admin</i></b><br/>
|
||||
I advise you to change this password as soon as possible.
|
||||
</td>
|
||||
<td style='padding-top:20px;'>
|
||||
<center>
|
||||
<input type='image'
|
||||
value='Ok, thanks'
|
||||
src='images/botao_ok.png'
|
||||
onclick='okThanks();'>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
This message will self destruct in <b><span id='selfDestroyCounter'>60</span></b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>";
|
||||
}else{
|
||||
echo "<body style='margin:0px;'>
|
||||
<style type='text/css'>
|
||||
BODY, TD
|
||||
{
|
||||
font-family: Tahoma;
|
||||
color: #555;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
<table style='width:100%;
|
||||
color:#444;
|
||||
background-color:#eec;
|
||||
border-bottom:solid 2px #669;
|
||||
padding: 7px;
|
||||
text-align:justify;
|
||||
position:absolute;
|
||||
top:0px;
|
||||
bottom:0px;'
|
||||
id='selfDestroyDiv'
|
||||
align='center'>
|
||||
<tr>
|
||||
<td>
|
||||
<img src='images/error.png'>
|
||||
</td>
|
||||
<td>
|
||||
<b>Error</b>: An error accurred when trying to access some files.<br/>
|
||||
<b>Tip</b>: Please, set permissions to your PHP server, to change AT LEAST these directories:<br/>
|
||||
<ul>
|
||||
<li>
|
||||
restrict/".$_MIND['userDir']."
|
||||
</li>
|
||||
<li>
|
||||
restrict/".$_MIND['publishDir']."
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td style='padding-top:20px;'>
|
||||
<center>
|
||||
<input type='image'
|
||||
src='images/try_again.png'
|
||||
onclick='self.location.href= self.location.href'>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
Due to keep theWebMind up to date, we advise you to set these permission to its whole directory
|
||||
</td>
|
||||
</tr>
|
||||
</table>";
|
||||
exit;
|
||||
}
|
||||
}else
|
||||
$info= false;
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
theWebMind
|
||||
</title>
|
||||
<link rel="shortcut icon" href="restrict/favico.png"/>
|
||||
<script src="restrict/framework/scripts/jquery.js"></script>
|
||||
<script src="restrict/framework/scripts/coockies.js"></script>
|
||||
<script>
|
||||
function okThanks()
|
||||
{
|
||||
clearInterval(vSelfDestroyCounter);
|
||||
$('#selfDestroyDiv').fadeOut('slow', function(){
|
||||
document.getElementById('selfDestroyDiv').parentNode.removeChild(document.getElementById('selfDestroyDiv'));
|
||||
});
|
||||
}
|
||||
function validate()
|
||||
{
|
||||
if(document.getElementById('name').value.replace(/ /g, '') == ''
|
||||
||
|
||||
document.getElementById('pwd').value.replace(/ /g, '') == '')
|
||||
{
|
||||
$("#mind_login_message").html("Both fields are needed");
|
||||
$("#mind_login_message").fadeIn("slow");
|
||||
return false;
|
||||
}
|
||||
if(document.getElementById('rememberMe').checked)
|
||||
{
|
||||
top.gravaCookie('theWebMind', top.document.getElementById('name').value, new Date(new Date().getTime() + (12*30*24*60*1000)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
$(document).ready(function(){
|
||||
document.getElementById('name').focus();
|
||||
var logInSavedValue= leCookie('theWebMind');
|
||||
if(logInSavedValue)
|
||||
{
|
||||
document.getElementById('rememberMe').checked= true;
|
||||
document.getElementById('name').value= logInSavedValue;
|
||||
document.getElementById('pwd').focus();
|
||||
}
|
||||
});
|
||||
function hideCCMsg()
|
||||
{
|
||||
document.getElementById('capsLockMessage').style.display= 'none';
|
||||
}
|
||||
function showCCMsg(o)
|
||||
{
|
||||
var m= document.getElementById('capsLockMessage');
|
||||
m.style.display= '';
|
||||
}
|
||||
function checkCapsLock(e, o)
|
||||
{
|
||||
var k=0;
|
||||
var sk=false;
|
||||
|
||||
// Internet Explorer
|
||||
if(document.all)
|
||||
{
|
||||
k=e.keyCode;
|
||||
}else if(document.getElementById) // browsers
|
||||
{
|
||||
k=e.which;
|
||||
}
|
||||
sk= e.shiftKey;
|
||||
// If it is in UpperCase when the shift is NOT pressed, or it is in lowerCase and the shift key is pressed
|
||||
if (
|
||||
((k > 64 && k < 91) && !sk)
|
||||
||
|
||||
((k > 96 && k < 123) && sk)
|
||||
)
|
||||
{
|
||||
showCCMsg(o);
|
||||
setTimeout(function(){hideCCMsg();}, 3000);
|
||||
}else{
|
||||
hideCCMsg();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style type='text/css'>
|
||||
BODY, TD
|
||||
{
|
||||
font-family: Tahoma;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
BODY
|
||||
{
|
||||
background-color: #fff;
|
||||
}
|
||||
fieldset, fieldset td
|
||||
{
|
||||
}
|
||||
#theFormToANewAccount, #theFormToANewAccount td
|
||||
{
|
||||
}
|
||||
#mind_login_message
|
||||
{
|
||||
color:red;
|
||||
height:22px;
|
||||
}
|
||||
.title
|
||||
{
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.botao
|
||||
{
|
||||
width: 95px;
|
||||
height: 20px;
|
||||
background-image: url(images/botao.jpg);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-color: #f0f0f0; /*EEECFB*/
|
||||
border: none;
|
||||
}
|
||||
.login_background
|
||||
{
|
||||
background-image:url(images/login_background.jpg);
|
||||
background-repeat:no-repeat;
|
||||
width:658px; /* 780px; */
|
||||
height: 490px; /* 598px; */
|
||||
border:solid 1px #236f77;
|
||||
}
|
||||
#contentHere
|
||||
{
|
||||
padding-top:70px;
|
||||
}
|
||||
.iptText
|
||||
{
|
||||
font-family:arial;
|
||||
border:solid 1px #146169;
|
||||
background-color: #fff;
|
||||
color:#146169;
|
||||
}
|
||||
.footer
|
||||
{
|
||||
margin-top:25px;
|
||||
*margin-top:110px; /* IE Sucks*/
|
||||
margin-left:7px;
|
||||
padding-top:7px;
|
||||
padding-left:12px;
|
||||
width: 400px;
|
||||
}
|
||||
#capsLockMessageContainer
|
||||
{
|
||||
position:absolute;
|
||||
left:0px;
|
||||
top:0px;
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
#capsLockMessage
|
||||
{
|
||||
position:absolute;
|
||||
margin-top:22px;
|
||||
width:240px;
|
||||
height:75px;
|
||||
border:solid 1px #666;
|
||||
background-color:#ffb;
|
||||
color:#333;
|
||||
padding:4px;
|
||||
text-align:justify;
|
||||
-moz-border-radius:5px;
|
||||
-webkit-border-radius:5px;
|
||||
}
|
||||
#selfDestroyCounter
|
||||
{
|
||||
color:#f00;
|
||||
}
|
||||
.extra-links a
|
||||
{
|
||||
}
|
||||
.extra-links img
|
||||
{
|
||||
margin-top:10px;
|
||||
border:none;
|
||||
width:26px;
|
||||
height:26px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body scroll='no' onload="" leftmargin='0' rightmargin='0' topmargin='0' bottommargin='0'>
|
||||
<noscript>
|
||||
Oh, common!!! You gotta be kidding!<br/>
|
||||
Turn on your javascript to enjoy theWebMind 2.0<br/><br/>
|
||||
If your browser does not support javascript, try one of these: Firefox, Chrome, Safari, Opera or even Internet Explorer 7+.
|
||||
</noscript>
|
||||
|
||||
<?php
|
||||
if(isset($info))
|
||||
{
|
||||
echo $info;
|
||||
}
|
||||
?>
|
||||
<table style='width: 100%; height: 100%;'>
|
||||
<tr>
|
||||
<td style='text-align: center;'>
|
||||
<center>
|
||||
<div class='login_background'>
|
||||
<div style='padding-left:70px;
|
||||
padding-top:70px;
|
||||
text-align: left;'>
|
||||
<span class='title'>
|
||||
TheWebMind 2.0
|
||||
</span><br>
|
||||
<div>
|
||||
Alpha Version - 2010
|
||||
</div><br><br>
|
||||
</div>
|
||||
<div id='contentHere'>
|
||||
<form onsubmit='return validate()'
|
||||
name='sub'
|
||||
action='login.php'
|
||||
method='post'
|
||||
target='hidden_frame'>
|
||||
<table>
|
||||
<tr>
|
||||
<td style='color:#fff;'>
|
||||
Login
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name='login'
|
||||
class='iptText'
|
||||
id='name'
|
||||
onKeyPress="checkCapsLock(event, this)">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='color:#fff;'>
|
||||
Password
|
||||
</td>
|
||||
<td>
|
||||
<div id="capsLockMessage"
|
||||
style='display:none;'>
|
||||
<b>Have you noticed your capsLock is on?</b><br/>
|
||||
<sup>
|
||||
<i>
|
||||
Please, remember that your password is caseSensitive. In other words, an upperCase letter has a different meaning than a lower.
|
||||
</i>
|
||||
</sup>
|
||||
</div>
|
||||
<input type='password'
|
||||
name='pass'
|
||||
class='iptText'
|
||||
id='pwd'
|
||||
onfocus="this.select();"
|
||||
onKeyPress="checkCapsLock(event, this)">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'
|
||||
style='text-align:center;'>
|
||||
<input type='checkbox'
|
||||
id='rememberMe'>
|
||||
Remember me
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<center>
|
||||
<input type='image'
|
||||
value='Go'
|
||||
src='images/botao_go.png'>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br>
|
||||
<span id="mind_login_message">
|
||||
<br>
|
||||
</span>
|
||||
</form>
|
||||
<table class='extra-links'>
|
||||
<tr>
|
||||
<td>
|
||||
<a href='http://docs.thewebmind.org'
|
||||
target='_quot'>
|
||||
<img src='http://www.thewebmind.org/img/ddl.png' title='Documentation' alt='Documentation' />
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href='http://groups.google.com.br/group/thewebmind'
|
||||
target='_quot'>
|
||||
<img src='http://www.thewebmind.org/img/group.png' title='Discussion Group' alt='Discussion Group' />
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href='http://thewebmind.org/contribute'
|
||||
target='_quot'>
|
||||
<img src='http://www.thewebmind.org/img/contribute.png' title='Contribute' alt='Contribute' />
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href='http://code.google.com/p/webmind/'
|
||||
target='_quot'>
|
||||
<img src='http://www.thewebmind.org/img/codes.png' title='Soure (at google code)' alt='Source (at google code)' />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div style='text-align:left;'>
|
||||
<div class='footer'>
|
||||
<table cellpadding='0'
|
||||
cellspacing='0'>
|
||||
<tr>
|
||||
<td style='vertical-align:top;'>
|
||||
<a target='_quot'
|
||||
href='http://thewebmind.org'>
|
||||
<img src='images/logo_top.png'
|
||||
align='left'
|
||||
style='border:none;'/>
|
||||
</a>
|
||||
</td>
|
||||
<td style='vertical-align:top;'>
|
||||
<!-- INICIO FORMULARIO BOTAO PAGSEGURO -->
|
||||
<form target="pagseguro" action="https://pagseguro.uol.com.br/security/webpagamentos/webdoacao.aspx" method="post"
|
||||
style='margin: 0px;
|
||||
padding: 0px;
|
||||
padding-left: 3px;'>
|
||||
<input type="hidden" name="email_cobranca" value="felipenmoura@gmail.com">
|
||||
<input type="hidden" name="moeda" value="BRL">
|
||||
<input type="image" src="https://pagseguro.uol.com.br/Security/Imagens/FacaSuaDoacao.gif" name="submit" alt="Pague com PagSeguro - é rápido, grátis e seguro!">
|
||||
</form>
|
||||
<!-- FINAL FORMULARIO BOTAO PAGSEGURO -->
|
||||
</td>
|
||||
<td>
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
||||
<input type="hidden" name="cmd" value="_s-xclick">
|
||||
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHLwYJKoZIhvcNAQcEoIIHIDCCBxwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCmMH67MnWELW5rfIb0sOOQ2gBQ/xiIIbb4jm1HH3VwcpOV/QW2AwhwvoUcFaAyUeSPUXDqptGsDZRXe/5h0CNzt64RDaWVYBCBPuYwKyFagYqknbAqlTnty3ip2o9MxZz9+oVqsmg1aRPHl89qG5CIx+Ji9tuK54pS5qSVcgpnSDELMAkGBSsOAwIaBQAwgawGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIPs+nku+0p/6AgYipudO9XrkV4MuDuPaAIkXgF9AhBsvrj/ffH6rv0+oUbK+ovGDuYcKA5Ffjqadv4AwHeSFSX/XLS8cWCI1yn3hk/71feb8T31t06jGmM5KwzLt4WlMzaqQKQxfgadJSJ3ujhWXVchPUqo63H2bdb8FH2y67ARfZujWJhIKNeEXt2geaMqQJVyfHoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDkwNjE0MTY0NzM2WjAjBgkqhkiG9w0BCQQxFgQUbiqwew5wkY6zPIo0t0ZGWt6+Lb4wDQYJKoZIhvcNAQEBBQAEgYCna84Xu/zeaPXlqw1ebDejrommfQB5+fgAnXGpy35P+fzqHvst0GTMxDqA3JHMm4KR54q1ZbZAEH76ljoN/8nYQL+xqksBlm16Kfi44Iq44Hunny9jkpnpXIw88CkR6YVAoPyef+c3ZyWoDXGA9JCCyHFhlq8i7gGBLIx0/FAT6Q==-----END PKCS7-----
|
||||
">
|
||||
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
||||
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<iframe name="hidden_frame" style="display:none;"></iframe>
|
||||
<?php
|
||||
if(isset($info))
|
||||
{
|
||||
?>
|
||||
<script>
|
||||
var vSelfDestroyCounter= false;
|
||||
setTimeout(function(){
|
||||
vSelfDestroyCounter= setInterval(function(){
|
||||
if(document.getElementById('selfDestroyCounter'))
|
||||
{
|
||||
if(document.getElementById('selfDestroyCounter').innerHTML == '0')
|
||||
{
|
||||
clearInterval(vSelfDestroyCounter);
|
||||
$('#selfDestroyDiv').fadeOut('slow', function(){
|
||||
document.getElementById('selfDestroyDiv').parentNode.removeChild(document.getElementById('selfDestroyDiv'));
|
||||
});
|
||||
return;
|
||||
}
|
||||
document.getElementById('selfDestroyCounter').innerHTML= document.getElementById('selfDestroyCounter').innerHTML-1;
|
||||
}
|
||||
}, 1000);
|
||||
}, 2000);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
include('restrict/config/mind.php');
|
||||
include('restrict/'.$_MIND['framework']);
|
||||
if(isset($_SESSION))
|
||||
{
|
||||
session_destroy();
|
||||
}
|
||||
$u= new User();
|
||||
$_MIND['rootDir']= 'restrict/';
|
||||
|
||||
if($_MIND['sessionDir'] != 'default')
|
||||
session_save_path('restrict/'.$_MIND['sessionDir']);
|
||||
session_start();
|
||||
?>
|
||||
<script>
|
||||
Mind= {
|
||||
Dialog:{
|
||||
ShowMessage: function (msg)
|
||||
{
|
||||
top.$("#mind_login_message").html("Error: Your login or password doesn't match.");
|
||||
top.$("#mind_login_message").fadeIn("slow");
|
||||
}
|
||||
}
|
||||
};
|
||||
<?php
|
||||
if(@$u->loadUser($_POST['login'], utf8_encode($_POST['pass'])))
|
||||
{
|
||||
if($_MIND['sessionLife']!== '0')
|
||||
session_cache_expire($_MIND['sessionLife']);
|
||||
$_SESSION['user'] = Array();
|
||||
$_SESSION['user']['name'] = $u->name();
|
||||
$_SESSION['user']['login'] = $u->login();
|
||||
$_SESSION['user']['age'] = $u->age();
|
||||
$_SESSION['user']['description']= $u->description();
|
||||
$_SESSION['user']['position'] = $u->position();
|
||||
$_SESSION['user']['status'] = $u->status();
|
||||
$_SESSION['user']['email'] = $u->email();
|
||||
$_SESSION['mind'] = Array();
|
||||
echo " top.location.href= 'restrict/index.php'; ";
|
||||
}else{
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</script>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
header ('Content-type: text/html; charset=utf-8');
|
||||
if($_MIND['sessionDir'] != 'default')
|
||||
session_save_path($_MIND['sessionDir']);
|
||||
session_start($_MIND['sessionLife']);
|
||||
if(!isset($_SESSION['user']['login']))
|
||||
{
|
||||
//echo "<b><span style='color:red;'>Permission Denied</span></b><br/><input type='button' value='Ok' onclick='top.location.href=\"../index.php\";'>";
|
||||
//echo "".$_MIND['rootDir']."index.php";
|
||||
header("Location:".$_MIND['rootDir']."../index.php");
|
||||
exit;
|
||||
}
|
||||
reset($_POST);
|
||||
foreach($_POST as $p)
|
||||
{
|
||||
if(isset($_POST[key($_POST)])){
|
||||
$_POST[key($_POST)]= $_MIND['fw']->treatClientInfo($_POST[key($_POST)]);
|
||||
next($_POST);
|
||||
}
|
||||
}
|
||||
date_default_timezone_set($_MIND["default_timezone"]);
|
||||
//ini_set('display_errors', 0);
|
||||
?>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
//include('../../'.$_MIND['header']);
|
||||
|
||||
if(!$_POST['pName'])
|
||||
{
|
||||
echo "Not allowed";
|
||||
exit;
|
||||
}
|
||||
$p= new Project($_POST['pName'], $_SESSION['user']['login']);
|
||||
?>
|
||||
<div style='height:100%;width:100%;overflow:hidden;'>
|
||||
<table cellpadding='0'
|
||||
cellspacing='0'
|
||||
class='mindLangEditorContainer'>
|
||||
<tr>
|
||||
<td class='header'>
|
||||
<table cellspacing='0'
|
||||
cellpadding='0'
|
||||
style='width:100%;'>
|
||||
<tr>
|
||||
<td style='width:200px;'>
|
||||
<div class='MindEditorButtons'>
|
||||
<img src="<?php echo $_MIND['imageDir']; ?>/bt_save.gif"
|
||||
onmouseover="showtip(this, event, 'Save current changes');
|
||||
this.src='<?php echo $_MIND['imageDir']; ?>/bt_save_over.gif'"
|
||||
onmouseout="this.src='<?php echo $_MIND['imageDir']; ?>/bt_save.gif'"
|
||||
onclick="Mind.Project.Save();"
|
||||
/><img src="<?php echo $_MIND['imageDir']; ?>/bt_prop.gif"
|
||||
onmouseover="showtip(this, event, 'Properties');
|
||||
this.src='<?php echo $_MIND['imageDir']; ?>/bt_prop_over.gif'"
|
||||
onmouseout="this.src='<?php echo $_MIND['imageDir']; ?>/bt_prop.gif'"
|
||||
onclick="Mind.Project.Properties('<?php echo $p->name; ?>');"
|
||||
/><img src="<?php echo $_MIND['imageDir']; ?>/bt_play.gif"
|
||||
onmouseover="showtip(this, event, 'Run/Simulate Project');
|
||||
this.src='<?php echo $_MIND['imageDir']; ?>/bt_play_over.gif'"
|
||||
onmouseout="this.src='<?php echo $_MIND['imageDir']; ?>/bt_play.gif'"
|
||||
onclick="Mind.Project.Run('<?php echo $p->name; ?>');"
|
||||
/><img src="<?php echo $_MIND['imageDir']; ?>/compiler.gif"
|
||||
onmouseover="showtip(this, event, 'Generate Project');
|
||||
this.src='<?php echo $_MIND['imageDir']; ?>/compiler_over.gif'"
|
||||
onmouseout="this.src='<?php echo $_MIND['imageDir']; ?>/compiler.gif'"
|
||||
onclick="Mind.Project.Generate()"
|
||||
/><img src="<?php echo $_MIND['imageDir']; ?>/bt_export.gif"
|
||||
onmouseover="showtip(this, event, 'Export Project');
|
||||
this.src='<?php echo $_MIND['imageDir']; ?>/bt_export_over.gif'"
|
||||
onmouseout="this.src='<?php echo $_MIND['imageDir']; ?>/bt_export.gif'"
|
||||
onclick="Mind.Project.Export();"
|
||||
/><img src="<?php echo $_MIND['imageDir']; ?>/bt_full_editor.png"
|
||||
onmouseover="showtip(this, event, 'Maximize/Restaure');
|
||||
this.src=this.src.replace(/.png$/, '_over.png')"
|
||||
onmouseout="this.src=this.src.replace(/_over.png$/, '.png')"
|
||||
id="mindEditorFullScreenButton"
|
||||
onclick="Mind.MindEditor.SetFull()"/>
|
||||
<br>
|
||||
</div>
|
||||
<img src='<?php echo $_MIND['imageDir']; ?>/mind_editor_gradient.png' style='padding:0px;margin:0px;*display:none; _display:none;'/><br>
|
||||
</td>
|
||||
<td style='text-align:left; font-weight:bold;color:#666;'>
|
||||
<?php
|
||||
echo $_POST['pName'].' <span id="currentVersionLabel">['.$p->version[0].'.'.$p->version[1].'.'.$p->version[2].']</span>';
|
||||
?>
|
||||
<span style='visibility:hidden;' id='mindEditorNotSavedMark'>
|
||||
<img src='<?php echo $_MIND['imageDir']; ?>/unsaved.jpg' />
|
||||
</span>
|
||||
</td>
|
||||
<td style='text-align: right; width: 50px;padding-right:8px;'>
|
||||
<img src='<?php echo $_MIND['imageDir']; ?>/red_close_button.png'
|
||||
onmouseover="this.src='<?php echo $_MIND['imageDir']; ?>/red_close_button_over.png';"
|
||||
onmouseout="this.src='<?php echo $_MIND['imageDir']; ?>/red_close_button.png';"
|
||||
onclick="Mind.Project.Close();"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='body'>
|
||||
<div id='mindEditor_Container'
|
||||
style='width:100%; height:100%; overflow:auto;'>
|
||||
<table cellpadding='0'
|
||||
cellspacing='0'
|
||||
style='width:100%;
|
||||
height:100%;'>
|
||||
<tr>
|
||||
<td class='mindEditor_lineNumberColumnArea' id="mindEditor_lineNumberColumnArea">
|
||||
<b id='mind_editor_lineNumber_1'> </b>
|
||||
</td>
|
||||
<td class='mindEditor_lineNumberColumn'
|
||||
id='mindEditor_lineNumberColumn'>1
|
||||
</td>
|
||||
<td style='vertical-align:top;' id='bgToChangeOnEditor'
|
||||
onscroll="alert(this)">
|
||||
<div style="position: relative;height:100%;width:100%;">
|
||||
<!--<img src='<?php echo $_MIND['imageDir']; ?>/back_gray.png' style="position:absolute; width: 100%; height: 100%;z-index:0;" />
|
||||
<img src='<?php echo $_MIND['imageDir']; ?>/gray_back_2.png' style="position:absolute; width: 100%; height: 100%;z-index:0;" />-->
|
||||
<textarea id='mindEditor'
|
||||
onkeyup='Mind.MindEditor.Typing(this.value, event);'
|
||||
onblur='Mind.Project.attributes.wml= this.value;'
|
||||
style="background-image:url(<?php echo $_MIND['imageDir']; ?>/gray_back_2.png);
|
||||
background-position:top center;
|
||||
background-attachment:fixed;"
|
||||
wrap="off"><?php echo $p->wml; ?></textarea>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='MindEditorFooterTools'>
|
||||
<td class='footer'>
|
||||
<table class='tools' style='width:100%;'>
|
||||
<tr>
|
||||
<td>
|
||||
<img src='<?php echo $_MIND['imageDir']; ?>/bt_print.png'
|
||||
onclick="Mind.MindEditor.Print();"
|
||||
style='cursor:pointer;'>
|
||||
</td>
|
||||
<td>
|
||||
<div id="win-xp" class="selCont">
|
||||
<select onchange="Mind.MindEditor.SetSize(this.value);" id="font_size_select">
|
||||
<option value='8'>8px</option>
|
||||
<option value='10'>10px</option>
|
||||
<option value='12' selected>12px</option>
|
||||
<option value='14'>14px</option>
|
||||
<option value='18'>18px</option>
|
||||
<option value='24'>24px</option>
|
||||
<option value='36'>36px</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class='bt' onclick="Mind.MindEditor.SetBold(this);">
|
||||
B
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class='bt'
|
||||
onclick="Mind.MindEditor.SetItalic(this);">
|
||||
I
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
Font
|
||||
</td>
|
||||
<td>
|
||||
<div class="fontColor"><div onclick="$('#colorpickerHolder').ColorPickerSetColor(this.style.backgroundColor||'666666'); Mind.MindEditor.ShowColorPicker(event, this);" changes='color'></div></div>
|
||||
</td>
|
||||
<td>
|
||||
Background
|
||||
</td>
|
||||
<td>
|
||||
<div class="bgColor"><div onclick="$('#colorpickerHolder').ColorPickerSetColor(this.style.backgroundColor||'ffffff'); Mind.MindEditor.ShowColorPicker(event, this);"
|
||||
changes='backgroundColor'></div></div>
|
||||
</td>
|
||||
<!--
|
||||
<td>
|
||||
<div class='replaceButton'>
|
||||
R
|
||||
</div>
|
||||
</td>-->
|
||||
<td>
|
||||
<img src='<?php echo $_MIND['imageDir']; ?>/search_for.png'
|
||||
onclick="Mind.MindEditor.ShowSearchPanel(event)"
|
||||
style='cursor:pointer;'
|
||||
title='Find in the code'
|
||||
align='left'/>
|
||||
</td>
|
||||
<td>
|
||||
<img src='<?php echo $_MIND['imageDir']; ?>/help.png'
|
||||
onclick="Mind.Help.Open('Web-Mind-Language')"
|
||||
style='cursor:pointer;'
|
||||
title='Help'/>
|
||||
</td>
|
||||
<td style='width:100%;text-align:right;'>
|
||||
<img src='<?php echo $_MIND['imageDir']; ?>/editor_tool.png'
|
||||
style='cursor:pointer;'
|
||||
class='normalButton'
|
||||
onmouseover='this.className= "buttonOver";'
|
||||
onmouseout='this.className= "normalButton";'
|
||||
onclick="Mind.MindEditor.ShowCodeEditor(event)" />
|
||||
<img src='<?php echo $_MIND['imageDir']; ?>/bt_close.png'
|
||||
style='cursor:pointer;'
|
||||
onclick="Mind.MindEditor.HideTools(); Mind.Panel['bottom'].Adjust();" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<iframe id='hiddenFrame'
|
||||
style='display:none;'></iframe>
|
||||
</div>
|
||||
<?php
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php // starting configuration file
|
||||
header ('Content-type: text/html; charset=utf-8');
|
||||
|
||||
$_MIND= Array();
|
||||
$_MIND['appName'] = 'theWebMind(s) - 2.0';
|
||||
$_MIND['wmlCurrentVersion'] = '1.0';
|
||||
$_MIND['home_page'] = 'http://latest.thewebmind.org/home.php'; //'http://latest.thewebmind.org/home.php';
|
||||
//$_MIND['home_page'] = 'http://localhost/thewebmind.org/latest/home.php';;
|
||||
$_MIND['updateSource'] = 'http://latest.thewebmind.org/current.xml';
|
||||
//$_MIND['updateSource'] = 'http://localhost/thewebmind.org/latest/current.xml';
|
||||
$_MIND['wmlVersion'] = Array();
|
||||
$_MIND['wmlVersion']['1.0'] = '<?wml version="1.0"?>';
|
||||
$_MIND['logDirectory'] = 'logs';
|
||||
$_MIND['cryptKey'] = 'theWebMind';
|
||||
$_MIND['header'] = 'components/header.php'; // the header to be loaded in each file
|
||||
$_MIND['components'] = 'components'; // the Mind components directory
|
||||
$_MIND['frameworkDir'] = 'framework'; // the framework directory
|
||||
$_MIND['framework'] = 'framework/mind-2.0.php'; // the framework to be loaded in each file
|
||||
$_MIND['sessionDir'] = 'default'; // aplies the default, or the specified directory to record sessions
|
||||
$_MIND['sessionLife'] = '0'; // the value in seconds, use "0" to end when the browser is closed
|
||||
$_MIND['userDir'] = 'users'; // directory to load user information
|
||||
$_MIND['userConfFile'] = 'conf'; // directory to load user information
|
||||
$_MIND['imageDir'] = 'images'; // directory to load images to Mind Interface
|
||||
$_MIND['scriptSrc'] = 'framework/scripts'; // directory to load scripts to Mind Interface
|
||||
$_MIND['styleSrc'] = 'framework/styles'; // directory to load CSS styles to Mind Interface
|
||||
$_MIND['themeSrc'] = 'framework/styles/themes'; // directory to load CSS styles to Mind Interface
|
||||
$_MIND['fwComponents'] = 'framework/components'; // components to be used by the mind framework
|
||||
$_MIND['dbmsDir'] = 'dbmss'; // directory to load DBMS configuration and libraries
|
||||
$_MIND['defaultDbms'] = 'postgres';
|
||||
$_MIND['default_timezone'] = 'America/Sao_Paulo';
|
||||
$_MIND['autoBackup'] = true; // generates a copy of the current version of the system, before replacing it
|
||||
$_MIND['pluginDir'] = 'plugins'; // directory to load plugins
|
||||
$_MIND['moduleDir'] = 'modules'; // directory to load modules
|
||||
$_MIND['defaultModule'] = 'php_mvc';
|
||||
$_MIND['languageDir'] = 'languages'; // directory to load modules
|
||||
$_MIND['defaultLanguage'] = 'en';
|
||||
$_MIND['licenses'] = '../licenses'; // the directory where you will find the licenses
|
||||
$_MIND['docs'] = 'docs'; // the directory where you will find the documentation and help content
|
||||
$_MIND['allowExport'] = true; // allows the user to export project information (when false, only admin can do it)
|
||||
$_MIND['rootDir'] = '';
|
||||
$_MIND['publishDir'] = 'projects';
|
||||
$_MIND['backupDir'] = '.MindBackUps';
|
||||
$_MIND['errorMessagesFile'] = 'messages/error.php';
|
||||
$_MIND['warningMessagesFile'] = 'messages/warning.php';
|
||||
$_MIND['tipMessagesFile'] = 'messages/tip.php';
|
||||
$_MIND['primaryKeyPrefix'] = 'pk_';
|
||||
$_MIND['foreignKeyPrefix'] = 'fk_';
|
||||
$_MIND['parentOnSelfRelation'] = 'main_';
|
||||
$_MIND['selfRelationalTable'] = '_pointer';
|
||||
$_MIND['showDeveloperMenu'] = false; // shows the menu DEVELOPER, or not
|
||||
$_MIND['load'] = Array();
|
||||
$_MIND['load']['user'] = 'classes/user.php';
|
||||
$_MIND['load']['project'] = 'classes/project.php';
|
||||
$_MIND['load']['plugin'] = 'classes/plugin.php';
|
||||
$_MIND['load']['module'] = 'classes/module.php';
|
||||
// $_MIND['load']['extraConfig'] = 'myConfigFile.php'; //to load extra configuration of yours, to the system, it may be used by your own modules, or plugins that require so
|
||||
$_MIND['version'] = '2.0';
|
||||
$_MIND['year'] = '2010';
|
||||
$_MIND['month'] = '';
|
||||
$_MIND['mindSpecificInfoAt'] = 'http://thewebmind.org/';
|
||||
$_MIND['developers'] = 'http://code.google.com/p/webmind/people/list';
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<root><defaultIdiom value="pt-BR"/><defaultDBMS value="PostgreSQL"/><lookForUpdate value="never"/><actionWithNewVersion value="-1"/><actionWithNewSubVersion value="-1"/><actionWithNewUpdates value="-1"/><useGlobalSynDic>on</useGlobalSynDic><useLocalSynDic>on</useLocalSynDic><addAutomatically>global</addAutomatically><reportDecisions>on</reportDecisions><reportDoubts>on</reportDoubts></root>
|
||||
@@ -0,0 +1,263 @@
|
||||
<?php
|
||||
/**
|
||||
* Classe responsável pela lógica para o SQLServer
|
||||
*
|
||||
* @link www.thewebmind.org
|
||||
* @version 1.0
|
||||
* @author Jaydson Gomes <jaydson@thewebmind.org>
|
||||
* @author Felipe Nascimento <felipe@thewebmind.org>
|
||||
*/
|
||||
class MSSQLServer implements dbmsInterface
|
||||
{
|
||||
public $attType= Array();
|
||||
|
||||
/**
|
||||
* Construtor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->attType= Array();
|
||||
$this->defaultPort= '5432';
|
||||
$this->attType['key'] = "int8 default nextval(<mind_simpleQuoting><schemaname>.<tablename>_seq</mind_simpleQuoting>)";
|
||||
$this->attType['varchar'] = "varchar(<length>)";
|
||||
$this->attType['char'] = "char(<length>)";
|
||||
$this->attType['text'] = "text";
|
||||
$this->attType['date'] = "datetime";
|
||||
$this->attType['blob'] = "bytea";
|
||||
$this->attType['integer'] = "integer";
|
||||
$this->attType['bigint'] = "int8";
|
||||
$this->attType['smallint'] = "smallint";
|
||||
$this->attType['int'] = "int";
|
||||
$this->attType['time'] = "datetime";
|
||||
$this->attType['dateTime'] = "datetime";
|
||||
$this->attType['real'] = "float";
|
||||
$this->attType['boolean'] = "boolean";
|
||||
$this->attType['serial'] = "serial";
|
||||
}
|
||||
|
||||
/**
|
||||
* Retorna o acronimo PDO
|
||||
* @return String
|
||||
*/
|
||||
public function getAcronymPDO(){
|
||||
return "mssql";
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera o ultimo erro
|
||||
*
|
||||
* @param Object $dbConn Conexão
|
||||
* @return String Erro
|
||||
*/
|
||||
function getLastError($dbConn){
|
||||
return '<b>Error Message:</b> '.mysql_error($dbConn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Conecta a base de dados
|
||||
*
|
||||
* @param Object $ob Objeto com os dados para conexão
|
||||
* @return Object Resource
|
||||
*/
|
||||
function connectTo($ob){
|
||||
if(is_array($ob))
|
||||
//$connection = "host=".$ob['dbAddress']." port=".$ob['dbPort']." dbname='".$ob['dbName']."' user='".$ob['rootUser']."' password='".$ob['rootUserPwd']."'";
|
||||
$connection = $ob['dbAddress'].':'.$ob['dbPort'].', '.$ob['rootUser'].', '.$ob['rootUserPwd'];
|
||||
else
|
||||
$connect = @mssql_connect( $ob->host.':'.$ob->port, $ob->user, $ob->pwd);
|
||||
if(is_array($ob))
|
||||
@mssql_select_db($ob['dbName']);
|
||||
else
|
||||
@mssql_select_db($ob->name);
|
||||
if($connect)
|
||||
return $connect;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Desconecta
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @return Object Resource
|
||||
*/
|
||||
function disconnectFrom($dbCon){
|
||||
$connect = mysql_close($dbCon);
|
||||
return $connect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifica se uma tabela existe
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @param String $table Nome da tabela
|
||||
* @return Object Resource
|
||||
*/
|
||||
function tableExists($dbConn, $table){
|
||||
return @mysql_query($dbConn, "select * from ".$table." limit 1");
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve o cabeçalho do arquivo SQL
|
||||
* @return String Header
|
||||
*/
|
||||
public function getHeader(){
|
||||
return "<mindComment>/*#####################################################</mindComment>
|
||||
<mindComment># Generated by Mind ".(date('H:i m/d/Y'))." #</mindComment>
|
||||
<mindComment># Generate MSSQL SERVER DataBase Commands #</mindComment>
|
||||
<mindComment>#######################################################*/</mindComment>
|
||||
|
||||
";
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve a função para conexão com o MySQL
|
||||
* @return String Função connectToMySQL()
|
||||
*/
|
||||
public function establishConnection()
|
||||
{
|
||||
return "function connectToMySQL(){
|
||||
\$db= '<dbname>';
|
||||
\$user= '<user>';
|
||||
\$pwd= '<pwd>';
|
||||
\$connection = \"host=<host> port=<port> dbname='\$db' user='\$user' password='\$pwd'\";
|
||||
\$connect = mysql_connect(\$connection);
|
||||
return \$connect;
|
||||
}";
|
||||
}
|
||||
|
||||
/**
|
||||
* Executa uma Query
|
||||
*
|
||||
* @param Object $dbCon Conexão
|
||||
* @param String $qr Query
|
||||
* @return Object Resource
|
||||
*/
|
||||
public function query($dbCon, $qr){
|
||||
return mysql_query($dbCon, $qr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fecha uma conexão
|
||||
* @return String Close
|
||||
*/
|
||||
public function closeConnection(){
|
||||
return "mysql_close(<query>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Equivalente mysql_fetch_array
|
||||
* @return String mysql_fetch_array
|
||||
*/
|
||||
public function fetchArray(){
|
||||
return "mysql_fetch_array(<source>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Retorna o ultimo erro
|
||||
* @return String mysql_error
|
||||
*/
|
||||
function lastError(){
|
||||
return 'mysql_error(<source>)';
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleta um campo
|
||||
* @return String mysql_query
|
||||
*/
|
||||
public function dropField(){
|
||||
return "mysql_query(<source>, 'alter table <table> drop column <column>'));";
|
||||
}
|
||||
|
||||
/**
|
||||
* Adiciona um campo
|
||||
* @return String mysql_query
|
||||
*/
|
||||
public function addField(){
|
||||
return "mysql_query(<source>, 'alter table <table> add column <column>'));";
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclui uma tabela
|
||||
* @return String drop
|
||||
*/
|
||||
public function dropTable(){
|
||||
return "mysql_query(<source>, 'drop table <table>'));";
|
||||
}
|
||||
|
||||
/**
|
||||
* Define um valor padrão
|
||||
* @return String default
|
||||
*/
|
||||
public function setDefaultValue(){
|
||||
return "default <defaultvalue>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Query
|
||||
* @return String mysql_query
|
||||
*/
|
||||
public function queryCommand(){
|
||||
return "mysql_query(<query>)";
|
||||
}
|
||||
|
||||
/*
|
||||
AINDA NÃO SUPORTADO
|
||||
*/
|
||||
public function createFieldComment(){}
|
||||
|
||||
/**
|
||||
* Cria um campo
|
||||
* @return String createField
|
||||
*/
|
||||
public function createField(){
|
||||
return "<element><fieldname></element> <fieldtype> <allownull> <defaultvalue>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria uma foreign key
|
||||
* @return String para criar Foreign Key
|
||||
*/
|
||||
public function createFK(){
|
||||
//return "<constructor>FOREIGN KEY</constructor>(<element><foreignkey></element>) <obj>REFERENCES</obj> <element><schemaname>.<references></element>";
|
||||
return "<constructor>ALTER TABLE</constructor> <objTable><table></objTable> <obj>ADD FOREIGN KEY<obj> (<element><fk></element>) <obj>REFERENCES</obj> <objTable><references></objTable>(<element><references_pk></element>);";
|
||||
}
|
||||
|
||||
/**
|
||||
* Adiciona uma foreign key
|
||||
* @return String para adicionar Primary Key
|
||||
*/
|
||||
public function addFK(){
|
||||
return "<constructor>FOREIGN KEY</constructor>(<element><foreignkey></element>) <obj>REFERENCES</obj> <element><references></element>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Primary Key padrão
|
||||
* @return String para Primary Key padrão
|
||||
*/
|
||||
public function defaultPrimaryKey(){
|
||||
return "<element><fieldname></element> integer <obj>IDENTITY</obj> <obj>unique</obj> <obj>not null</obj>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria uma primary key
|
||||
* @return String para criar Primary Key
|
||||
*/
|
||||
public function createPK(){
|
||||
return "<constructor>PRIMARY KEY</constructor>(<element><pk></element>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria Tabela
|
||||
* @return String para criar tabela
|
||||
*/
|
||||
public function createTable()
|
||||
{
|
||||
return " <mindComment>/* DDL: table <tablename> */</mindComment>
|
||||
<constructor>CREATE</constructor> <obj>TABLE</obj> <objTable><tablename></objTable>
|
||||
<element>(</element>
|
||||
<fields>
|
||||
<element>)</element>;";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,341 @@
|
||||
<?php
|
||||
/**
|
||||
* Classe respons�vel pela l�gica para o MySQL
|
||||
*
|
||||
* @link www.thewebmind.org
|
||||
* @version 1.0
|
||||
* @author Jaydson Gomes <jaydson@thewebmind.org>
|
||||
* @author Felipe Nascimento <felipenmoura@thewebmind.org>
|
||||
*/
|
||||
class MySQL implements dbmsInterface
|
||||
{
|
||||
public $attType= Array();
|
||||
public $adoName= 'mysql';
|
||||
|
||||
/**
|
||||
* Construtor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->attType= Array();
|
||||
$this->defaultPort= '5432';
|
||||
$this->attType['key'] = "int8 default nextval(<mind_simpleQuoting><schemaname>.<tablename>_seq</mind_simpleQuoting>)";
|
||||
$this->attType['varchar'] = "varchar(<length>)";
|
||||
$this->attType['char'] = "char(<length>)";
|
||||
$this->attType['text'] = "text";
|
||||
$this->attType['date'] = "timestamp";
|
||||
$this->attType['blob'] = "bytea";
|
||||
$this->attType['integer'] = "integer";
|
||||
$this->attType['bigint'] = "int8";
|
||||
$this->attType['smallint'] = "int2";
|
||||
$this->attType['int'] = "int4";
|
||||
$this->attType['time'] = "timestamp";
|
||||
$this->attType['dateTime'] = "timestamp";
|
||||
$this->attType['real'] = "float";
|
||||
$this->attType['boolean'] = "boolean";
|
||||
$this->attType['serial'] = "serial";
|
||||
}
|
||||
|
||||
/**
|
||||
* Retorna o acronimo PDO
|
||||
* @return String
|
||||
*/
|
||||
public function getAcronymPDO(){
|
||||
return "mysql";
|
||||
}
|
||||
/**
|
||||
* Gets how to select the schema
|
||||
* @name selectSchema
|
||||
* @return String
|
||||
*/
|
||||
public function selectSchema($schemaName){
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the schema
|
||||
* @name selectCurrentSchema
|
||||
* @return resource
|
||||
*/
|
||||
public function selectCurrentSchema($dbConn, $schemaName){
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Remover todas as constraints realcionadas � tabela recebida, e entao rmover a tabela
|
||||
* @return String
|
||||
*/
|
||||
public function removeTable($dbConn, $tableName){
|
||||
$r= @mysql_query("select k.constraint_name,
|
||||
c.table_name
|
||||
from information_schema.key_column_usage k,
|
||||
information_schema.table_constraints c
|
||||
where c.table_schema = schema()
|
||||
and c.constraint_type='FOREIGN KEY'
|
||||
and k.constraint_schema= schema()
|
||||
and k.constraint_name= c.constraint_name
|
||||
and referenced_table_name = '".$tableName."'", $dbConn);
|
||||
while($cur= mysql_fetch_assoc($r))
|
||||
{
|
||||
$alter= mysql_query("ALTER TABLE `".$cur['table_name']."` DROP FOREIGN KEY `".$cur['constraint_name']."`", $dbConn);
|
||||
if(!$alter)
|
||||
return false;
|
||||
}
|
||||
$r= mysql_query("DROP TABLE ".$tableName, $dbConn);
|
||||
return $r? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera o ultimo erro
|
||||
*
|
||||
* @param Object $dbConn Conex�o
|
||||
* @return String Erro
|
||||
*/
|
||||
function getLastError($dbConn){
|
||||
return '<br/><b>Error Message:</b> '.mysql_error($dbConn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Conecta a base de dados
|
||||
*
|
||||
* @param Object $ob Objeto com os dados para conex�o
|
||||
* @return Object Resource
|
||||
*/
|
||||
function connectTo($ob){
|
||||
if(is_array($ob))
|
||||
$connect= @mysql_connect($ob['dbAddress'].':'.$ob['dbPort'], $ob['rootUser'], $ob['rootUserPwd']);
|
||||
else
|
||||
$connect = @mysql_connect( $ob->host.':'.$ob->port, $ob->user, $ob->pwd);
|
||||
if(is_array($ob))
|
||||
@mysql_select_db($ob['dbName']);
|
||||
else
|
||||
@mysql_select_db($ob->name);
|
||||
if($connect)
|
||||
return $connect;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Desconecta
|
||||
*
|
||||
* @param Object $dbCon Conex�o
|
||||
* @return Object Resource
|
||||
*/
|
||||
function disconnectFrom($dbCon){
|
||||
$connect = mysql_close($dbCon);
|
||||
return $connect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifica se uma tabela existe
|
||||
*
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $table Nome da tabela
|
||||
* @return Boolean
|
||||
*/
|
||||
function tableExists($dbConn, $table){
|
||||
$r= @mysql_query("select * from ".$table." limit 1", $dbConn);
|
||||
return $r? true: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retorna os campos da tabela
|
||||
*
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $table Nome da tabela
|
||||
* @return ObjectCollection of fields
|
||||
*/
|
||||
function getFields($dbConn, $table){
|
||||
$r= @mysql_query("select * from ".$table." limit 1", $dbConn);
|
||||
$r= mysql_fetch_assoc($r);
|
||||
$ar= Array();
|
||||
while($cur= current($r))
|
||||
{
|
||||
$ar[]= key($cur);
|
||||
next($r);
|
||||
}
|
||||
return $ar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve o cabe�alho do arquivo SQL
|
||||
* @return String Header
|
||||
*/
|
||||
public function getHeader(){
|
||||
return "<mindComment>/*####################################################</mindComment>
|
||||
<mindComment># Generated by Mind ".(date('H:i m/d/Y'))." #</mindComment>
|
||||
<mindComment># Generate MySQL DataBase Commands #</mindComment>
|
||||
<mindComment>######################################################*/</mindComment>
|
||||
|
||||
";
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve a fun��o para conex�o com o MySQL
|
||||
* @return String Fun��o connectToMySQL()
|
||||
*/
|
||||
public function establishConnection()
|
||||
{
|
||||
return "function connectToMySQL(){
|
||||
\$db= '<dbname>';
|
||||
\$user= '<user>';
|
||||
\$pwd= '<pwd>';
|
||||
\$connection = \"host=<host> port=<port> dbname='\$db' user='\$user' password='\$pwd'\";
|
||||
\$connect = mysql_connect(\$connection);
|
||||
return \$connect;
|
||||
}";
|
||||
}
|
||||
|
||||
/**
|
||||
* Executa uma Query
|
||||
*
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $qr Query
|
||||
* @return Object Resource
|
||||
*/
|
||||
public function query($dbCon, $qr){
|
||||
return mysql_query($qr, $dbCon);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fecha uma conex�o
|
||||
* @return String Close
|
||||
*/
|
||||
public function closeConnection(){
|
||||
return "mysql_close(<query>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Equivalente mysql_fetch_array
|
||||
* @return String mysql_fetch_array
|
||||
*/
|
||||
public function fetchArray(){
|
||||
return "mysql_fetch_array(<source>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Retorna o ultimo erro
|
||||
* @return String mysql_error
|
||||
*/
|
||||
function lastError(){
|
||||
return 'mysql_error(<source>)';
|
||||
}
|
||||
|
||||
/**
|
||||
* Query para deletar um campo
|
||||
* @return String mysql_query
|
||||
*/
|
||||
public function dropField(){
|
||||
return "mysql_query(<source>, 'alter table <table> drop column <column>'));";
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove um campo da tabela
|
||||
* @return String mysql_query
|
||||
*/
|
||||
public function dropColumn($dbCon, $table, $col){
|
||||
$r= mysql_query('alter table '.$table.' drop column '.$col, $dbCon);
|
||||
return $r? true: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove um campo da tabela
|
||||
* @return String mysql_query
|
||||
*/
|
||||
public function addColumn($dbCon, $table, $col){
|
||||
$r= mysql_query('alter table '.$table.' add column '.$col, $dbCon);
|
||||
return $r? true: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adiciona um campo
|
||||
* @return String mysql_query
|
||||
*/
|
||||
public function addField(){
|
||||
return "mysql_query(<source>, 'alter table <table> add column <column>'));";
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclui uma tabela
|
||||
* @return String drop
|
||||
*/
|
||||
public function dropTable(){
|
||||
return "mysql_query(<source>, 'drop table <table>'));";
|
||||
}
|
||||
|
||||
/**
|
||||
* Define um valor padr�o
|
||||
* @return String default
|
||||
*/
|
||||
public function setDefaultValue(){
|
||||
return "default <defaultvalue>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Query
|
||||
* @return String mysql_query
|
||||
*/
|
||||
public function queryCommand(){
|
||||
return "mysql_query(<query>)";
|
||||
}
|
||||
|
||||
/*
|
||||
AINDA N�O SUPORTADO
|
||||
*/
|
||||
public function createFieldComment(){}
|
||||
|
||||
/**
|
||||
* Cria um campo
|
||||
* @return String createField
|
||||
*/
|
||||
public function createField(){
|
||||
return "<element><fieldname></element> <fieldtype> <allownull> <defaultvalue>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria uma foreign key
|
||||
* @return String para criar Foreign Key
|
||||
*/
|
||||
public function createFK(){
|
||||
//return "<constructor>FOREIGN KEY</constructor>(<element><foreignkey></element>) <obj>REFERENCES</obj> <element><schemaname>.<references></element>";
|
||||
return "<constructor>ALTER TABLE</constructor> <objTable><table></objTable> <obj>ADD FOREIGN KEY<obj> (<element><fk></element>) <obj>REFERENCES</obj> <objTable><references></objTable>(<element><references_pk></element>);";
|
||||
}
|
||||
|
||||
/**
|
||||
* Adiciona uma foreign key
|
||||
* @return String para adicionar Primary Key
|
||||
*/
|
||||
public function addFK(){
|
||||
return "<constructor>FOREIGN KEY</constructor>(<element><foreignkey></element>) <obj>REFERENCES</obj> <element><references></element>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Primary Key padr�o
|
||||
* @return String para Primary Key padr�o
|
||||
*/
|
||||
public function defaultPrimaryKey(){
|
||||
return "<element><fieldname></element> integer <obj>auto_increment</obj> <obj>unique</obj> <obj>not null</obj>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria uma primary key
|
||||
* @return String para criar Primary Key
|
||||
*/
|
||||
public function createPK(){
|
||||
return "<constructor>PRIMARY KEY</constructor>(<element><pk></element>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria Tabela
|
||||
* @return String para criar tabela
|
||||
*/
|
||||
public function createTable()
|
||||
{
|
||||
return " <mindComment>/* DDL: table <tablename> */</mindComment>
|
||||
<constructor>CREATE</constructor> <obj>TABLE</obj> <objTable><tablename></objTable>
|
||||
<element>(</element>
|
||||
<fields>
|
||||
<element>)</element>ENGINE = InnoDB;";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
/**
|
||||
* Classe respons�vel pela l�gica para o PostgreSQL
|
||||
*
|
||||
* @link www.thewebmind.org
|
||||
* @version 1.0
|
||||
* @author Jaydson Gomes <jaydson@thewebmind.org>
|
||||
* @author Felipe Nascimento <felipenmoura@thewebmind.org>
|
||||
*/
|
||||
class PostgreSQL implements dbmsInterface
|
||||
{
|
||||
public $attType= Array();
|
||||
public $adoName= Array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->attType = Array();
|
||||
$this->defaultPort = '5432';
|
||||
$this->attType['key'] = "int8 default nextval(<mind_simpleQuoting><schemaname>.<tablename>_seq</mind_simpleQuoting>)";
|
||||
$this->attType['varchar'] = "varchar(<length>)";
|
||||
$this->attType['char'] = "char(<length>)";
|
||||
$this->attType['text'] = "text";
|
||||
$this->attType['date'] = "timestamp";
|
||||
$this->attType['blob'] = "bytea";
|
||||
$this->attType['file'] = "bytea";
|
||||
$this->attType['integer'] = "integer";
|
||||
$this->attType['bigint'] = "int8";
|
||||
$this->attType['smallint'] = "int2";
|
||||
$this->attType['int'] = "int4";
|
||||
$this->attType['time'] = "timestamp";
|
||||
$this->attType['dateTime'] = "timestamp";
|
||||
$this->attType['real'] = "float";
|
||||
$this->attType['boolean'] = "boolean";
|
||||
$this->attType['serial'] = "serial";
|
||||
}
|
||||
|
||||
/**
|
||||
* Retorna o acronimo PDO
|
||||
* @return String
|
||||
*/
|
||||
public function getAcronymPDO(){
|
||||
return "pgsql";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets how to select the schema
|
||||
* @name selectSchema
|
||||
* @return String
|
||||
*/
|
||||
public function selectSchema($schemaName){
|
||||
return "SET searchpath to ".$schemaName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the schema
|
||||
* @name selectCurrentSchema
|
||||
* @return resource
|
||||
*/
|
||||
public function selectCurrentSchema($dbConn, $schemaName){
|
||||
return pg_query($dbConn, "SET searchpath to ".$schemaName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remover todas as constraints realcionadas à tabela recebida, e entao rmover a tabela
|
||||
* @return String
|
||||
*/
|
||||
public function removeTable($dbConn, $tableName){
|
||||
GLOBAL $_MIND;
|
||||
$r= pg_query($dbConn, " SELECT c.conname AS constraint_name,
|
||||
t.relname AS table_name,
|
||||
t2.relname AS references_table
|
||||
FROM pg_constraint c
|
||||
LEFT JOIN pg_class t ON c.conrelid = t.oid
|
||||
LEFT JOIN pg_class t2 ON c.confrelid = t2.oid
|
||||
WHERE c.contype= 'f'
|
||||
AND t2.relname = '".$tableName."'");
|
||||
while($cur= pg_fetch_assoc($r))
|
||||
{
|
||||
$alter= pg_query($dbConn, "ALTER TABLE ".$cur['table_name']." DROP CONSTRAINT ".$cur['constraint_name']);
|
||||
if(!$alter)
|
||||
return false;
|
||||
}
|
||||
$r= @pg_query($dbConn, "DROP TABLE ".$tableName);
|
||||
|
||||
$alter= @pg_query($dbConn, "DROP sequence ".$tableName."_".$_MIND['primaryKeyPrefix']."".$tableName."_seq");
|
||||
return $r && $alter? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recupera o ultimo erro
|
||||
*
|
||||
* @param Object $dbConn Conex�o
|
||||
* @return String Erro
|
||||
*/
|
||||
function getLastError($dbConn)
|
||||
{
|
||||
return '<b>Error Message:</b> '.pg_last_error($dbConn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Conecta a base de dados
|
||||
*
|
||||
* @param Object $ob Objeto com os dados para conex�o
|
||||
* @return Object Resource
|
||||
*/
|
||||
function connectTo($ob)
|
||||
{
|
||||
if(is_array($ob))
|
||||
$connection = "host=".$ob['dbAddress']." port=".$ob['dbPort']." dbname='".$ob['dbName']."' user='".$ob['rootUser']."' password='".$ob['rootUserPwd']."'";
|
||||
else
|
||||
$connection = "host=".$ob->host." port=".$ob->port." dbname='".$ob->name."' user='".$ob->user."' password='".$ob->pwd."'";
|
||||
|
||||
$connect = pg_connect($connection);
|
||||
return $connect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Desconecta
|
||||
*
|
||||
* @param Object $dbCon Conex�o
|
||||
* @return Object Resource
|
||||
*/
|
||||
function disconnectFrom($dbCon)
|
||||
{
|
||||
$connect = pg_close($dbCon);
|
||||
return $connect;
|
||||
}
|
||||
/**
|
||||
* Verifica se uma tabela existe
|
||||
*
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $table Nome da tabela
|
||||
* @return Boolean
|
||||
*/
|
||||
function tableExists($dbConn, $table)
|
||||
{
|
||||
$r= @pg_query($dbConn, "SELECT relname FROM pg_class WHERE relname = '".$table."'");
|
||||
//$r= @pg_query($dbConn, "select * from ".$table." limit 1");
|
||||
return (pg_num_rows($r) == 0)? false:true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve o cabe�alho do arquivo SQL
|
||||
* @return String Header
|
||||
*/
|
||||
public function getHeader()
|
||||
{
|
||||
return "<mindComment>/*######################################################</mindComment>
|
||||
<mindComment> # Generated by Mind ".(date('H:i m/d/Y'))." #</mindComment>
|
||||
<mindComment> # Generate PostgreSQL DataBase Commands #</mindComment>
|
||||
<mindComment> ######################################################*/</mindComment>
|
||||
|
||||
";
|
||||
}
|
||||
|
||||
/**
|
||||
* Escreve a fun��o para conex�o com o Postgres
|
||||
* @return String Fun��o connectToPostgres()
|
||||
*/
|
||||
public function establishConnection()
|
||||
{
|
||||
return "function connectToPostgres(){
|
||||
\$db= '<dbname>';
|
||||
\$user= '<user>';
|
||||
\$pwd= '<pwd>';
|
||||
\$connection = \"host=<host> port=<port> dbname='\$db' user='\$user' password='\$pwd'\";
|
||||
\$connect = pg_connect(\$connection);
|
||||
return \$connect;
|
||||
}";
|
||||
}
|
||||
|
||||
/**
|
||||
* Executa uma Query
|
||||
*
|
||||
* @param Object $dbCon Conex�o
|
||||
* @param String $qr Query
|
||||
* @return Object Resource
|
||||
*/
|
||||
public function query($dbCon, $qr)
|
||||
{
|
||||
return pg_query($dbCon, $qr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fecha uma conex�o
|
||||
* @return String Close
|
||||
*/
|
||||
public function closeConnection()
|
||||
{
|
||||
return "pg_close(<query>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Equivalente pg_fetch_array
|
||||
* @return String pg_fetch_array
|
||||
*/
|
||||
public function fetchArray()
|
||||
{
|
||||
return "pg_fetch_array(<source>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Retorna o ultimo erro
|
||||
* @return String pg_last_error
|
||||
*/
|
||||
function lastError()
|
||||
{
|
||||
return 'pg_last_error(<source>)';
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleta um campo
|
||||
* @return String pg_query
|
||||
*/
|
||||
public function dropField()
|
||||
{
|
||||
return "pg_query(<source>, 'alter table <table> drop column <column>'));";
|
||||
}
|
||||
|
||||
/**
|
||||
* Adiciona um campo
|
||||
* @return String pg_query
|
||||
*/
|
||||
public function addField()
|
||||
{
|
||||
return "pg_query(<source>, 'alter table <table> add column <column>'));";
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclui uma tabela
|
||||
* @return String drop
|
||||
*/
|
||||
public function dropTable()
|
||||
{
|
||||
return "pg_query(<source>, 'drop table <table>'));";
|
||||
}
|
||||
|
||||
/**
|
||||
* Define um valor padr�o
|
||||
* @return String default
|
||||
*/
|
||||
public function setDefaultValue()
|
||||
{
|
||||
return "default <defaultvalue>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Query
|
||||
* @return String pg_query
|
||||
*/
|
||||
public function queryCommand()
|
||||
{
|
||||
return "pg_query(<query>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria um campo
|
||||
* @return String createField
|
||||
*/
|
||||
public function createFieldComment()
|
||||
{
|
||||
return "<constructor>COMMENT ON</constructor> <element>COLUMN</element> <schemaname>.<tablename>.<fieldname> <constructor>is</constructor> '<fieldComment>';";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria um campo
|
||||
* @return String createField
|
||||
*/
|
||||
public function createField()
|
||||
{
|
||||
return "<element><fieldname></element> <fieldtype> <allownull> <defaultvalue>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria uma foreign key
|
||||
* @return String para criar Foreign Key
|
||||
*/
|
||||
public function createFK()
|
||||
{
|
||||
//return "<constructor>ALTER TABLE</constructor> <objTable><table></objTable> <obj>ADD CONSTRAINT</obj> <table>_<references> <obj>FOREIGN KEY<obj> <element><fk></element> <obj>REFERENCES</obj> <objTable><references></objTable> MATCH FULL;";
|
||||
return "<constructor>ALTER TABLE</constructor> <objTable><table></objTable> <obj>ADD CONSTRAINT</obj> <table>_<references> <obj>FOREIGN KEY<obj> (<element><fk></element>) <obj>REFERENCES</obj> <objTable><references></objTable>(<element><references_pk></element>) MATCH FULL;";
|
||||
}
|
||||
|
||||
/**
|
||||
* Adiciona uma foreign key
|
||||
* @return String para adicionar Primary Key
|
||||
*/
|
||||
public function addFK()
|
||||
{
|
||||
return "<constructor>FOREIGN KEY</constructor>(<element><foreignkey></element>) <obj>REFERENCES</obj> <element><references></element>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Primary Key padr�o
|
||||
* @return String para Primary Key padr�o
|
||||
*/
|
||||
public function defaultPrimaryKey()
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
return "<element><fieldname></element> integer default nextval('<tablename>_".$_MIND['primaryKeyPrefix']."<tablename>_seq') <obj>unique</obj> <obj>not null</obj>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria uma primary key
|
||||
* @return String para criar Primary Key
|
||||
*/
|
||||
public function createPK()
|
||||
{
|
||||
return "<constructor>PRIMARY KEY</constructor>(<element><pk></element>)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Cria Tabela
|
||||
* @return String para criar tabela
|
||||
*/
|
||||
public function createTable()
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
return " <mindComment>/* DDL: table <tablename> */</mindComment>
|
||||
<constructor>CREATE</constructor> <obj>SEQUENCE</obj> <tablename>_".$_MIND['primaryKeyPrefix']."<tablename>_seq;
|
||||
<constructor>CREATE</constructor> <obj>TABLE</obj> <objTable><tablename></objTable>
|
||||
<element>(</element>
|
||||
<fields>
|
||||
<element>)</element>;";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
interface dbmsInterface
|
||||
{
|
||||
public function query($dbCon, $qr); // executes a query into the dataBase
|
||||
public function connectTo($dbObject); // OPENS a connection to the dataBase
|
||||
public function disconnectFrom($connectionObject); // CLOSES the connection to the dataBase
|
||||
public function getLastError($dbCon); // returns the last occurred error
|
||||
public function tableExists($conObj, $table); // returns false if the table doesn't exist
|
||||
|
||||
public function selectSchema($schemaName); // return the string to select the schema if supported or "" if not
|
||||
public function selectCurrentSchema($dbConn,
|
||||
$schemaName); // selects the current schema, if supported, or true if not
|
||||
public function getHeader(); // returns the header, like comments on top, possible variables or calls to select dataBase
|
||||
public function establishConnection(); // returns the STRING needed to the connection
|
||||
public function closeConnection(); // returns the STRING needed to the disconnection
|
||||
public function fetchArray(); // returns the STRING of the command used to fetch the result into an Array
|
||||
public function lastError(); // returns the STRING of the command used to get the lest error
|
||||
public function addField(); // returns the STRING of the command used to add fields
|
||||
public function dropTable(); // returns the STRING of the command used to drop a table
|
||||
public function dropField(); // returns the STRING of the command used to remove a field from a table
|
||||
public function queryCommand(); // returns the STRING of the command used to exec a query
|
||||
public function createFieldComment(); // returns the STRING of the command used to add a comment on fields
|
||||
public function addFK(); // returns the STRING of the command used to add a foreignkey to a table
|
||||
public function createPK(); // returns the STRING of the command used to specify the primary key
|
||||
public function createTable(); // returns the STRING of the command used to create a table
|
||||
public function createField(); // returns the STRING of the command used to create a field into the createTable command
|
||||
public function setDefaultValue();
|
||||
public function defaultPrimaryKey();
|
||||
public function removeTable($dbConn, $tableName);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
include('config/mind.php');
|
||||
include($_MIND['framework']);
|
||||
include($_MIND['header']);
|
||||
|
||||
session_destroy();
|
||||
header('Location: ../index.php');
|
||||
?>
|
||||
|
Depois Largura: | Altura: | Tamanho: 4.3 KiB |
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
class Attribute
|
||||
{
|
||||
public $name;
|
||||
public $type;
|
||||
public $defaultValue;
|
||||
public $mask;
|
||||
public $size;
|
||||
public $required;
|
||||
public $references;
|
||||
public $pk;
|
||||
public $hidden=false;
|
||||
|
||||
public function __construct($attName=false)
|
||||
{
|
||||
if($attName)
|
||||
$this->name= $attName;
|
||||
$this->pk=false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
.yui-button
|
||||
{
|
||||
font-family:Arial;
|
||||
background: url('../img/sprite.png') repeat-x 0px 0px;
|
||||
color: #0192BF;
|
||||
font-weight:bold;
|
||||
border: 2px solid #989898;
|
||||
cursor:pointer;
|
||||
padding:1px;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
class FW
|
||||
{
|
||||
private $mDir;
|
||||
private $pDir;
|
||||
|
||||
public function pDir($d)
|
||||
{
|
||||
$this->pDir= $d;
|
||||
}
|
||||
|
||||
public function mDir($d)
|
||||
{
|
||||
$this->mDir= $d;
|
||||
}
|
||||
|
||||
public function mkDir($name,$permission=0777)
|
||||
{
|
||||
if(!file_exists($this->pDir.'/'.$name)){
|
||||
mkdir($this->pDir.'/'.$name,$permission);
|
||||
}
|
||||
}
|
||||
|
||||
public function mkFile($name, $content)
|
||||
{
|
||||
if(file_exists($this->pDir))
|
||||
{
|
||||
$name= $this->pDir.'/'.$name;
|
||||
if(!@fopen($name, 'w+'))
|
||||
trigger_error("Directory not accessible", E_USER_ERROR);
|
||||
file_put_contents($name, $content);
|
||||
}else{
|
||||
trigger_error("Directory not accessible", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public function rename($name,$new_name){
|
||||
if(file_exists($this->pDir."/".$name)){
|
||||
rename($this->pDir."/".$name,$this->pDir."/".$new_name);
|
||||
}
|
||||
}
|
||||
|
||||
public function getContent($file){
|
||||
return file_get_contents($this->mDir."/".$file);
|
||||
}
|
||||
|
||||
public function __construct(){
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,696 @@
|
||||
<?php
|
||||
//header('Content-Type: text/plain; charset=ISO-8859-1');
|
||||
//include('scripts/functions.php');
|
||||
include('sgbd.php');
|
||||
include('dataBase.php');
|
||||
include('schema.php');
|
||||
include('table.php');
|
||||
include('attribute.php');
|
||||
include('primaryKey.php');
|
||||
include('foreignKey.php');
|
||||
session_start();
|
||||
ini_set("memory_limit","80M");
|
||||
set_time_limit(3600); // uma hora
|
||||
//include('');
|
||||
class MindProcessor
|
||||
{
|
||||
private $HAS = ' |||||||HAS||||||| ';
|
||||
private $OR = ' |||||||OR||||||| ';
|
||||
private $USELESS= ' |||||||USELESS||||||| ';
|
||||
private $DEFAULTSIZEATTRIBUTE= 16;
|
||||
private $details= '<pre>';
|
||||
private $configDirectory= '';//$_SESSION['mind']['configDirectory'];
|
||||
public $query = '';
|
||||
private $xml = '';
|
||||
private $base = '';
|
||||
public $dataBases= Array();
|
||||
public $description= '';
|
||||
public $projectName= "";
|
||||
public $language= 'en';
|
||||
private $defaultDataBase= 'Postgres';
|
||||
private $versionFirstLevel= '0';
|
||||
private $versionSecondLevel= '1';
|
||||
private $versionThirdLevel= '0';
|
||||
|
||||
public function setLanguage($language)
|
||||
{
|
||||
if(!$language || $language=='')
|
||||
$language= 'en';
|
||||
$this->language= $language;
|
||||
require_once('languages/'.$language.'.php');
|
||||
}
|
||||
public function formatParam($x)
|
||||
{
|
||||
GLOBAL $l;
|
||||
$x= trim($this->fixChars($x, $l['charsToFix'], $l['fixedChars']));
|
||||
if(strpos($x, '\"') !== false)
|
||||
$x= str_replace(' ', '_', trim(str_replace('\"', '', substr($x, strpos($x, '\"'), strrpos($x, '\"')))));
|
||||
if(strpos($x, ' ') !== false)
|
||||
$x= substr($x, 0, strpos($x, ' '));
|
||||
$p= '/\W/';
|
||||
return preg_replace($p, '', $x);
|
||||
}
|
||||
public function var2attribute($str)
|
||||
{
|
||||
$reg= '/[A-Z*]/';
|
||||
$matched = preg_split($reg, $str, -1, PREG_SPLIT_OFFSET_CAPTURE);
|
||||
$len= count($matched);
|
||||
for($i=0; $i<$len; $i++)
|
||||
{
|
||||
if($i!=$len-1)
|
||||
{
|
||||
$char= '_'.strtolower(substr($str, $matched[$i+1][1]-1, 1));
|
||||
}else
|
||||
$char= '';
|
||||
$matched[$i]= $matched[$i][0].$char;
|
||||
}
|
||||
return $str= preg_replace('/^_/', '', join($matched));
|
||||
}
|
||||
public function attribute2var($str)
|
||||
{
|
||||
$str= preg_replace('/_$/', '', preg_replace('/^_/', '', $str));
|
||||
$str= explode('_', $str);
|
||||
for($i=1; $i<count($str); $i++)
|
||||
{
|
||||
$str[$i]= ucfirst($str[$i]);
|
||||
}
|
||||
return join($str);
|
||||
}
|
||||
public function fixChars($text, $ar1, $ar2, $var= false)
|
||||
{
|
||||
for($c=0; $c<count($ar1); $c++)
|
||||
{
|
||||
$text= str_replace($ar1[$c], $ar2[$c], $text);
|
||||
}
|
||||
if($var)
|
||||
$text= $this->attribute2var($text);
|
||||
else
|
||||
$text= $this->var2attribute($text);
|
||||
return $text;
|
||||
}
|
||||
public function addDetails($d)
|
||||
{
|
||||
$this->details.= $d;
|
||||
}
|
||||
public function getDetails($textOnly=false)
|
||||
{
|
||||
if($textOnly)
|
||||
{
|
||||
$header= "Generated automatically by Mind
|
||||
|
||||
";
|
||||
$ret= str_replace('<br>', '\n', $this->getDetails());
|
||||
return str_replace('<br/>', '\n', $ret);
|
||||
}
|
||||
return $this->details;
|
||||
}
|
||||
public function showDetails($textOnly=false)
|
||||
{
|
||||
if($textOnly)
|
||||
{
|
||||
$ret= str_replace('<br>', '\n', $this->getDetails());
|
||||
return str_replace('<br/>', '\n', $ret);
|
||||
}else
|
||||
return '<pre>'.$this->getDetails().'</pre>';
|
||||
}
|
||||
public function replaceFromArray($ar, $r, $text)
|
||||
{
|
||||
for($c=0; $c<count($ar); $c++)
|
||||
{
|
||||
$text= str_replace($ar[$c], $r, $text);
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
public function arrayInString($ar, $text, $b= false, $dir=false)
|
||||
{
|
||||
foreach($ar as $l)
|
||||
{
|
||||
if(preg_match('/^'.trim($l).'/', $text) > 0)
|
||||
{
|
||||
$r= Array(''.$l.'', ''.strpos($text, trim($l)).'', ''.strlen($l).'');
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function generate($schemaName, $db, $cd)
|
||||
{
|
||||
// Data Base
|
||||
GLOBAL $l;
|
||||
$this->base= trim($cd);
|
||||
$this->projectName= trim($this->fixChars($this->projectName, $l['charsToFix'], $l['fixedChars']));
|
||||
$this->tmpXMLFile= 'tmp/structure_'.$_SESSION['user']['cod'].'.xml';
|
||||
fopen($this->tmpXMLFile, 'w+');
|
||||
file_put_contents($this->tmpXMLFile, '<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<mind>
|
||||
</mind>');
|
||||
|
||||
$this->xml = simplexml_load_file($this->tmpXMLFile);
|
||||
|
||||
$this->xml->addChild('base');
|
||||
$this->xml->base['language']= $this->language;
|
||||
$this->xml->base->addChild('name', urlencode($this->projectName));
|
||||
$this->xml->base->addChild('version', $this->versionFirstLevel.'.'.$this->versionSecondLevel.'.'.$this->versionThirdLevel);
|
||||
$this->xml->base->addChild('date', date('m/d/Y'));
|
||||
$this->xml->base->date['day']= date('d');
|
||||
$this->xml->base->date['month']= date('m');
|
||||
$this->xml->base->date['year']= date('Y');
|
||||
$this->xml->base->date['hour']= date('H');
|
||||
$this->xml->base->date['minute']= date('i');
|
||||
$this->xml->base->date['second']= date('s');
|
||||
$this->xml->base->addChild('description', urlencode($this->description));
|
||||
$this->xml->base->addChild('mindcode', (str_replace('&', '&', urlencode($this->base))));
|
||||
$this->xml->addChild('databases');
|
||||
|
||||
$dbCount= 0;
|
||||
foreach($this->dataBases as $db)
|
||||
{
|
||||
$db->name= trim($this->fixChars($db->name, $l['charsToFix'], $l['fixedChars']));
|
||||
$this->xml->databases->addChild('database');
|
||||
$this->xml->databases->database[$dbCount]['address']= $db->dbAddress;
|
||||
$this->xml->databases->database[$dbCount]['name']= $db->name;
|
||||
$port= explode(':', $db->dbAddress);
|
||||
$port= (count($port)>1)? $port[1]: $db->SGBD->execute->defaultPort;
|
||||
$this->xml->databases->database[$dbCount]['port']= $port;
|
||||
$this->xml->databases->database[$dbCount]['sgbd']= (trim($db->SGBD->name) != '')? $db->SGBD->name: $this->defaultDataBase;
|
||||
$this->xml->databases->database[$dbCount]->addChild('root');
|
||||
$this->xml->databases->database[$dbCount]->root['username']= $db->rootUser;
|
||||
$this->xml->databases->database[$dbCount]->root['password']= $db->rootUserPwd;
|
||||
$this->xml->databases->database[$dbCount]->addChild('user');
|
||||
$this->xml->databases->database[$dbCount]->user['username']= $db->user;
|
||||
$this->xml->databases->database[$dbCount]->user['password']= $db->userPwd;
|
||||
$this->xml->databases->database[$dbCount]->addChild('schemas');
|
||||
$atualSchema= $db->name;
|
||||
foreach($db->schemas as $schema)
|
||||
{
|
||||
$this->xml->databases->database[$dbCount]->schemas->addChild('schema');
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema['name']= $schema->name;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema['description']= $schema->description;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema->addChild('tables');
|
||||
|
||||
$p= '/\/\*(.|\W)*?\*\//';
|
||||
$t= preg_replace($p, '', $cd);
|
||||
$t= preg_split('/\n/', $t);
|
||||
|
||||
GLOBAL $l;
|
||||
$this->details.= "Creating schema: ".$atualSchema."<br>";
|
||||
foreach($t as $linha)
|
||||
{
|
||||
$linha= $this->replaceFromArray($l['links'], $this->HAS, $linha);
|
||||
$linha= explode($this->HAS, $linha);
|
||||
if(count($linha) > 1)
|
||||
{ // possui HAS ou derivados
|
||||
$lin= $linha[0];
|
||||
$lin= explode(' ', trim($lin));
|
||||
$tableLeft= $lin[count($lin)-1];
|
||||
// tabela da esquerda
|
||||
/*if(substr($tableLeft, strlen($tableLeft)-1) == '"')
|
||||
$tableLeft= substr(join('_', $lin), strpos(join('_', $lin), '"')+1, -2);*/
|
||||
$tableLeft= $this->formatParam($tableLeft);
|
||||
if(!$schema->tables[$tableLeft])
|
||||
{
|
||||
$schema->addTable($tableLeft, false, $db->SGBD);
|
||||
$this->addDetails("Creating table: ".$tableLeft."<br>");
|
||||
}
|
||||
// tabela da direita
|
||||
$lin= $linha[1];
|
||||
$lin= $this->replaceFromArray($l['or'], $this->OR, $lin);
|
||||
$lin= explode('//', $lin, 2);
|
||||
$comment= $lin[1];
|
||||
if(strpos($lin[0], ":"))
|
||||
{ // atributo
|
||||
$attName= substr($lin[0], 0, strpos($lin[0], ":"));
|
||||
//$attName= str_replace($this->USELESS, '', $lin);
|
||||
if(substr($attName, strlen(trim($attName))-1) == '"')
|
||||
{
|
||||
$tmpAttName= strpos($attName, '"');
|
||||
//$attName= str_replace(' ', '_', trim(str_replace('\"', '', substr($attName, $tmpAttName+1, strrpos($attName, '\"')))));
|
||||
$attName= $this->formatParam($attName);
|
||||
}else{
|
||||
$attName= substr($attName, strrpos($attName, ' '));
|
||||
}
|
||||
$attName= trim($this->fixChars($attName, $l['charsToFix'], $l['fixedChars']));
|
||||
$attType= substr(strchr($lin[0], ":"), 1);
|
||||
// verifica aqui, os tipos de attributos
|
||||
$attType= Attribute::getCaracteristics($attType);
|
||||
$attTypeName= '';
|
||||
if(strpos($attType, '('))
|
||||
{
|
||||
$attType= trim($attType);
|
||||
$strParPos= strpos($attType, '(');
|
||||
$attTypeName= substr($attType, 0, $strParPos);
|
||||
$attTypeSP= substr($attType, $strParPos+1, -1);
|
||||
$attTypeSP= explode(',', $attTypeSP, 2);
|
||||
$attTypeSize= trim($attTypeSP[0]);
|
||||
}else{
|
||||
$attTypeName= $attType;
|
||||
$attTypeSize= $this->DEFAULTSIZEATTRIBUTE;
|
||||
}
|
||||
reset($l['type']);
|
||||
while(next($l['type']))
|
||||
{
|
||||
if(in_array($attTypeName, $l['type'][key($l['type'])]))
|
||||
{
|
||||
$attTypeName= key($l['type']);
|
||||
$attTypeName= $db->SGBD->getSGBD()->attType[$attTypeName];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$attTypeName= trim($this->fixChars($attTypeName, $l['charsToFix'], $l['fixedChars']));
|
||||
$attName= trim($this->fixChars($attName, $l['charsToFix'], $l['fixedChars']));
|
||||
|
||||
if(!$schema->tables[$tableLeft]->attributes[$attName])
|
||||
{
|
||||
$attTypeName= Array($attTypeName);
|
||||
$attTypeName[1]= $attTypeSize;
|
||||
$attTypeName[2]= $attTypeSP[1];
|
||||
$this->details.= 'Creating attribute: '.$attName.' of type '.$attTypeName[0].' on table '.$tableLeft.'<br>';
|
||||
if($schema->tables[$tableLeft]->tableName != $tableLeft)
|
||||
$attName= $tableLeft.'_'.$attName;
|
||||
$schema->tables[$tableLeft]->addAttribute($attName, $attTypeName, $comment);
|
||||
}
|
||||
$attTypeSP= false;
|
||||
$attTypeSize= false;
|
||||
$attName= false;
|
||||
$attTypeName= false;
|
||||
}else{ // liga��o de tabela
|
||||
$cu++;
|
||||
if(strpos($lin[0], $this->OR))
|
||||
{ // min E max
|
||||
$lin= explode($this->OR, $lin[0], 2);
|
||||
$tmpMin= ($this->arrayInString($l['cardinalityMin'][0], $lin[0], true))? '0':(($this->arrayInString($l['cardinalityMin'][1], $lin[0], true))? '1': 'q');
|
||||
$rghtTbl= $this->arrayInString($l['cardinalityMax'][1], ' '.$lin[1], true);
|
||||
|
||||
$x= $this->arrayInString($l['cardinalityMax'][0], $lin[1], true);
|
||||
if($x === false)
|
||||
{
|
||||
$x= $this->arrayInString($l['cardinalityMax'][1], $lin[1], true);
|
||||
$tmpMax= 'n';
|
||||
}else
|
||||
$tmpMax= '1';
|
||||
$tmpRhtTbl= $lin[1];
|
||||
|
||||
}else{ // somente max
|
||||
$tmpRhtTbl= $lin[0];
|
||||
$tmpMin= 0;
|
||||
|
||||
$x= $this->arrayInString($l['cardinalityMax'][0], $tmpRhtTbl, true);
|
||||
if($x === false)
|
||||
{
|
||||
$x= $this->arrayInString($l['cardinalityMax'][1], $tmpRhtTbl);
|
||||
$tmpMax= 'n';
|
||||
}else
|
||||
$tmpMax= '1';
|
||||
}
|
||||
$sum= $x[1]+$x[2];
|
||||
if($sum!=0)
|
||||
$sum--;
|
||||
$rghtTbl= substr($tmpRhtTbl, $sum);
|
||||
$rghtTbl= $this->formatParam($rghtTbl);
|
||||
|
||||
if(!$schema->tables[$rghtTbl])
|
||||
{
|
||||
$schema->addTable($rghtTbl, false, $db->SGBD);
|
||||
$this->addDetails("Creating table: ".$rghtTbl."<br>");
|
||||
}
|
||||
if($tmpMax == 1)
|
||||
{
|
||||
if($db->verifyFKs($schema->tables[$schema->tables[$rghtTbl]->tableName], 'fk_'.$schema->tables[$tableLeft]->tableName))
|
||||
{ // sao 1 para 1
|
||||
$rghtTbl= $schema->tables[$rghtTbl]->tableName;
|
||||
$tableRight= $schema->tables[$schema->tables[$tableLeft]->tableName]->addAttribute('fk_'.$rghtTbl, Attribute::getCaracteristics($l['type']['integer'][0].'(8)'), $comment);
|
||||
$schema->tables[$schema->tables[$tableLeft]->tableName]->addForeignKey($tableRight, $rghtTbl, $schema->name);
|
||||
$this->details.= 'Adding Foreign key on '.$schema->tables[$tableLeft]->tableName.': '.'fk_'.$rghtTbl.' references '.$rghtTbl.'<br>';
|
||||
}else{
|
||||
if($schema->tables[$rghtTbl]->tableName != $tableLeft && $schema->tables[$schema->tables[$tableLeft]->tableName]->tableName != $rghtTbl)
|
||||
{
|
||||
$rghtTbl= $schema->tables[$rghtTbl]->tableName;
|
||||
$tableRight= $schema->tables[$schema->tables[$tableLeft]->tableName]->addAttribute('fk_'.$rghtTbl, Attribute::getCaracteristics($l['type']['integer'][0].'(8)'), $comment);
|
||||
$schema->tables[$schema->tables[$tableLeft]->tableName]->addForeignKey($tableRight, $rghtTbl, $schema->name);
|
||||
$this->details.= 'Adding Foreign key on '.$schema->tables[$tableLeft]->tableName.': '.'fk_'.$rghtTbl.' references '.$rghtTbl.'<br>';
|
||||
}
|
||||
}
|
||||
}elseif($tmpMax == 'n')
|
||||
{
|
||||
if($db->verifyFKs($schema->tables[$schema->tables[$tableLeft]->tableName], 'fk_'.$schema->tables[$rghtTbl]->tableName))
|
||||
{ // sao n para n
|
||||
//$newTable= $schema->addTable($tableLeft.'_'.$rghtTbl, true); // GAMBI !! melhorar esta parte
|
||||
$newTable= $schema->addTable($tableLeft.'_'.$rghtTbl, false, $db->SGBD);
|
||||
// fim GAMBI
|
||||
$this->addDetails("Creating table: ".$newTable->tableName."<br>");
|
||||
$fk1= $newTable->addAttribute('fk_'.$tableLeft, Attribute::getCaracteristics($l['type']['integer'][0].'(8)'), $comment);
|
||||
$fk2= $newTable->addAttribute('fk_'.$rghtTbl, Attribute::getCaracteristics($l['type']['integer'][0].'(8)'), $comment);
|
||||
|
||||
$newTable->addForeignKey($fk2, $schema->tables[$rghtTbl]->tableName, $schema->name);
|
||||
$this->details.= 'Adding Foreign key on '.$schema->tables[$newTable->tableName]->tableName.': '.'fk_'.$rghtTbl.' references '.$rghtTbl.'<br>';
|
||||
$newTable->addForeignKey($fk1, $schema->tables[$tableLeft]->tableName, $schema->name);
|
||||
$this->details.= 'Adding Foreign key on '.$schema->tables[$newTable->tableName]->tableName.': '.'fk_'.$tableLeft.' references '.$tableLeft.'<br>';
|
||||
|
||||
unset($schema->tables[$schema->tables[$tableLeft]->tableName]->foreignKeys['fk_'.$schema->tables[$rghtTbl]->tableName]);
|
||||
unset($schema->tables[$schema->tables[$tableLeft]->tableName]->attributes['fk_'.$schema->tables[$rghtTbl]->tableName]);
|
||||
|
||||
$newTable->addPrimaryKey($fk1, $name);
|
||||
$newTable->addPrimaryKey($fk2, $name);
|
||||
}else{
|
||||
$tableLeftReference= $schema->tables[$schema->tables[$rghtTbl]->tableName]->addAttribute('fk_'.$schema->tables[$schema->tables[$tableLeft]->tableName]->tableName, Attribute::getCaracteristics($l['type']['integer'][0].'(8)'), $comment);
|
||||
$schema->tables[$schema->tables[$rghtTbl]->tableName]->addForeignKey($tableLeftReference, $schema->tables[$schema->tables[$tableLeft]->tableName]->tableName, $schema->name);
|
||||
$this->details.= 'Adding Foreign key on '.$schema->tables[$rghtTbl]->tableName.': '.'fk_'.$schema->tables[$schema->tables[$tableLeft]->tableName]->tableName.' references '.$schema->tables[$schema->tables[$tableLeft]->tableName]->tableName.'<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$comment= '';
|
||||
}
|
||||
$db->organizeTables($schema->name);
|
||||
|
||||
$dbCount= 0;
|
||||
$scCount= 0;
|
||||
$tableCount= 0;
|
||||
$attCound= 0;
|
||||
foreach($this->dataBases as $db)
|
||||
{
|
||||
foreach($db->schemas as $schema)
|
||||
{
|
||||
foreach($schema->tables as $table)
|
||||
{
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->addChild('table');
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]['name']= $table->tableName;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]['id']= $table->getSerial();
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]['description']= $table->description;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->addChild('attributes');
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->addChild('requires');
|
||||
for($kk=0;$kk<count($table->requires);$kk++)
|
||||
{
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->requires->addChild("required", $table->requires[$kk]);
|
||||
//echo '<b><i>'.$table->requires[$kk].' - '.'</i></b>';
|
||||
//$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->requires->addChild("required", $table->requires[$kk]);
|
||||
|
||||
}
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->requires;
|
||||
foreach($table->attributes as $attribute)
|
||||
{
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->addChild('attribute');
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['name']= $attribute->attName;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['id']= $attribute->attName;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['pk']= ($table->primaryKeys[$attribute->attName])? 1: 0;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['type']= $attribute->attType;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['limit']= $attribute->size;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['references']= ($table->foreignKeys[$attribute->attName])? $table->foreignKeys[$attribute->attName]->target : '';
|
||||
|
||||
|
||||
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['default']= utf8_encode($attribute->attDefault);
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['description']= '';
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['notnull']= ($table->primaryKeys[$attribute->attName])? 1: 0;
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['comment']= utf8_encode($attribute->attComment);
|
||||
$this->xml->databases->database[$dbCount]->schemas->schema[$scCount]->tables->table[$tableCount]->attributes->attribute[$attCound]['mask']= '';
|
||||
$attCound++;
|
||||
}
|
||||
$attCound= 0;
|
||||
$tableCount++;
|
||||
}
|
||||
$tableCount= 0;
|
||||
$scCount++;
|
||||
}
|
||||
$scCount= 0;
|
||||
$dbCount++;
|
||||
}
|
||||
$dbCount= 0;
|
||||
// XML
|
||||
file_put_contents($this->tmpXMLFile, $this->xml->asXML());
|
||||
|
||||
/*foreach($this->dataBases as $db)
|
||||
{
|
||||
}*/
|
||||
|
||||
//$this->generateQuery();
|
||||
//$this->generateXML();
|
||||
}
|
||||
}
|
||||
$projectConfigDirectory= $this->configDirectory;
|
||||
$jsonFile= '../'.$projectConfigDirectory.'json_data.php';
|
||||
//if(!file_exists($jsonFile))
|
||||
fopen($jsonFile, 'w+');
|
||||
//fclose($jsonFileObj);
|
||||
//chmod ($jsonFile, 0777);
|
||||
file_put_contents($jsonFile, json_encode($this));
|
||||
$this->xml= $this->xml->asXML();//(string)$this->xml;
|
||||
}
|
||||
public function applySqlStyle($sql, $el, $show= true)
|
||||
{
|
||||
if($show)
|
||||
$sql= str_replace('</'.$el.'>', '</span>', str_replace('<'.$el.'>', "<span class='".$el."SQLElement'>", $sql));
|
||||
else
|
||||
$sql= str_replace('</'.$el.'>', '', str_replace('<'.$el.'>', '', $sql));
|
||||
return $sql;
|
||||
}
|
||||
public function showQuery($db, $b= false)
|
||||
{
|
||||
$qrToShow= $this->dataBases[$db]->showQuery($b);
|
||||
//echo htmlentities($qrToShow);
|
||||
$xmlTmp= simplexml_load_string($this->xml);
|
||||
/*print_r($xmlTmp);
|
||||
echo '<hr>';*/
|
||||
//$xml= unserialize($this->xml);
|
||||
$dbCount= 0;
|
||||
foreach($this->dataBases as $db)
|
||||
{
|
||||
$schemaCount= 0;
|
||||
foreach($db->schemas as $schema)
|
||||
{
|
||||
$tableCount= 0;
|
||||
foreach($schema->tables as $table)
|
||||
{
|
||||
$xmlTable= $xmlTmp->databases->database[$dbCount]->schemas->schema[$schemaCount]->tables->table[$tableCount];
|
||||
//echo $table->getQuery().'<hr>';
|
||||
$qrToUse= $this->applySqlStyle($table->getQuery(), 'constructor', false);
|
||||
$qrToUse= $this->applySqlStyle($qrToUse, 'mindComment', false);
|
||||
$qrToUse= $this->applySqlStyle($qrToUse, 'obj', false);
|
||||
$qrToUse= $this->applySqlStyle($qrToUse, 'element', false);
|
||||
$xmlTable['sql']= utf8_encode($qrToUse);
|
||||
$attCount= 0;
|
||||
foreach($table->attributes as $attribute)
|
||||
{
|
||||
$qrToUse= $attribute->query;
|
||||
$qrToUse= $this->applySqlStyle($qrToUse, 'constructor', false);
|
||||
$qrToUse= $this->applySqlStyle($qrToUse, 'mindComment', false);
|
||||
$qrToUse= $this->applySqlStyle($qrToUse, 'obj', false);
|
||||
$qrToUse= $this->applySqlStyle($qrToUse, 'element', false);
|
||||
$xmlTable->attributes->attribute[$attCount]['query']= utf8_encode($qrToUse);
|
||||
//echo '<br>';
|
||||
$xmlTable;
|
||||
$attCount++;
|
||||
}
|
||||
$tableCount++;
|
||||
}
|
||||
$schemaCount++;
|
||||
}
|
||||
$dbCount++;
|
||||
}
|
||||
file_put_contents($this->tmpXMLFile, $xmlTmp->asXML());
|
||||
//echo $qrToShow;
|
||||
//echo ($b)? 1: 0;
|
||||
|
||||
$this->query= $qrToShow;
|
||||
$qrToShow= $this->applySqlStyle($qrToShow, 'constructor', $b);
|
||||
$qrToShow= $this->applySqlStyle($qrToShow, 'mindComment', $b);
|
||||
$qrToShow= $this->applySqlStyle($qrToShow, 'obj', $b);
|
||||
$qrToShow= $this->applySqlStyle($qrToShow, 'element', $b);
|
||||
return utf8_encode($qrToShow);
|
||||
}
|
||||
public function showXML($db, $b=false)
|
||||
{
|
||||
if($b)
|
||||
{
|
||||
return "<iframe id='showXMLIframe' src='".$this->tmpXMLFile."' style='width: 100%; height: 100%; border: none; display: inline;' frameborder='0'></iframe>";
|
||||
}
|
||||
else
|
||||
return file_get_contents($this->tmpXMLFile);
|
||||
}
|
||||
public function addDataBase($dbName= "DataBase's Name", $schemaName, $address, $rootUser, $rootUserPwd, $user, $userPwd, $SGBD, $description= '')
|
||||
{
|
||||
GLOBAL $l;
|
||||
$dbName= trim($this->fixChars($dbName, $l['charsToFix'], $l['fixedChars']));
|
||||
$this->dataBases[$dbName]= new DataBase(((trim($SGBD) != '')? $SGBD: $this->defaultDataBase));
|
||||
$this->dataBases[$dbName]->name= $dbName;
|
||||
$this->dataBases[$dbName]->dbAddress= $address;
|
||||
$this->dataBases[$dbName]->rootUser= $rootUser;
|
||||
$this->dataBases[$dbName]->rootUserPwd= $rootUserPwd;
|
||||
$this->dataBases[$dbName]->user= $user;
|
||||
$this->dataBases[$dbName]->userPwd= $userPwd;
|
||||
$this->dataBases[$dbName]->schemas[$schemaName]->description= $description;
|
||||
$this->dataBases[$dbName]->addSchema($schemaName);
|
||||
}
|
||||
public function generateStructure($project)
|
||||
{
|
||||
if($project)
|
||||
{
|
||||
$ret= '';
|
||||
foreach($project->dataBases as $obj)
|
||||
{
|
||||
$ret.= "<ul class='database' type='none'>
|
||||
<li>
|
||||
<span style='cursor: pointer;'
|
||||
onclick='var tmp= this.parentNode.getElementsByTagName(\"UL\");
|
||||
for(i=0; i<tmp.length; i++)
|
||||
{
|
||||
if(tmp[i].style.display == \"none\")
|
||||
tmp[i].style.display = \"\";
|
||||
else
|
||||
tmp[i].style.display= \"none\";
|
||||
}'>".$obj->name.'</span>';
|
||||
foreach($obj->schemas as $schema)
|
||||
{
|
||||
$ret.= "<ul class='schema' type='none'><li>";
|
||||
$ret.= "<span style='cursor: pointer;'
|
||||
onclick='var tmp= this.parentNode.getElementsByTagName(\"UL\");
|
||||
for(i=0; i<tmp.length; i++)
|
||||
{
|
||||
if(tmp[i].style.display == \"none\")
|
||||
tmp[i].style.display = \"\";
|
||||
else
|
||||
tmp[i].style.display= \"none\";
|
||||
}'>".$schema->name."</span>";
|
||||
foreach($schema->tables as $table)
|
||||
{
|
||||
$ret.= "<ul class='table' type='none'>
|
||||
<li>";
|
||||
$ret.= "<span style='cursor: pointer;'
|
||||
onclick=' var tmp= this.parentNode.getElementsByTagName(\"UL\");
|
||||
for(i=0; i<tmp.length; i++)
|
||||
{
|
||||
if(tmp[i].style.display == \"none\")
|
||||
tmp[i].style.display = \"\";
|
||||
else
|
||||
tmp[i].style.display= \"none\";
|
||||
}'>".$table->tableName."</span>";
|
||||
foreach($table->attributes as $attribute)
|
||||
{
|
||||
if($table->primaryKeys[$attribute->attName])
|
||||
$className= 'primaryKey';
|
||||
else
|
||||
$className= 'attribute';
|
||||
$ret.= "<ul class='".$className."' style='display: none;' type='none'>";
|
||||
$ret.= '<li style="cursor: pointer;">'.$attribute->attName.'</li>';
|
||||
$ret.= "</ul>";
|
||||
}
|
||||
$ret.= ' </li>
|
||||
</ul>';
|
||||
}
|
||||
$ret.= '</li></ul>';
|
||||
}
|
||||
$ret.= '</li></ul>';
|
||||
}
|
||||
}else{
|
||||
$ret= 'No structure to show now';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
public function generateERDiagram()
|
||||
{
|
||||
$derContent= file_get_contents('der_tool.php');
|
||||
return $derContent;//"<iframe src='der.php' style='display: block; width: 100%; height: 100%;'></iframe>";
|
||||
}
|
||||
public function generateDataDictionary($project)
|
||||
{
|
||||
$ret= '';
|
||||
foreach($project->dataBases as $obj)
|
||||
{
|
||||
$header.= '<h1>'.$obj->name.'</h1>';
|
||||
$header.= '<p style="padding-left: 25px;">Schemas: '.count($obj->schemas).' ';
|
||||
$header.= '(';
|
||||
$countTmp=0;
|
||||
foreach($obj->schemas as $schema)
|
||||
{
|
||||
$header.= (($countTmp==0)? '': (($countTmp==count($obj->schemas)-1)? ' and ': '---')).$schema->name;
|
||||
$countTmp++;
|
||||
}
|
||||
$header.= ')';
|
||||
$header.= '</p>';
|
||||
|
||||
foreach($obj->schemas as $schema)
|
||||
{
|
||||
$ret.= '<div style="padding-left: 25px;"><h2>'.$schema->name.'</h2>';
|
||||
foreach($schema->tables as $table)
|
||||
{
|
||||
$ret.= '<div style="padding-left: 25px;
|
||||
margin-bottom: 15px;">
|
||||
<table style="width: 90%;"
|
||||
cellpadding="0"
|
||||
cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<span style="padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
margin-left: 7px;
|
||||
font-weight: bold;
|
||||
text-align:center;
|
||||
background-color: #d0d0d0;
|
||||
cursor: default;
|
||||
border: solid 1px #000;">'.$table->tableName.'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: #d0d0d0;
|
||||
border: solid 1px #000;
|
||||
cursor: default;">
|
||||
<table style="width: 100%;"
|
||||
cellpadding="0"
|
||||
cellspacing="0">
|
||||
<tr style="border-bottom: solid 1px #fff">
|
||||
<td style="border-right: solid 1px #fff">
|
||||
<br>
|
||||
</td>
|
||||
<td style="text-align: center; font-weight: bold; border-right: solid 1px #fff">
|
||||
Type
|
||||
</td>
|
||||
<td style="text-align: center; font-weight: bold; border-right: solid 1px #fff">
|
||||
Size
|
||||
</td>
|
||||
<td style="text-align: center; font-weight: bold; border-right: solid 1px #fff">
|
||||
Default
|
||||
</td>
|
||||
<td style="text-align: center; font-weight: bold; border-right: solid 1px #fff">
|
||||
Null
|
||||
</td>
|
||||
<td style="text-align: center; font-weight: bold; border-right: solid 1px #fff">
|
||||
References
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
foreach($table->attributes as $attribute)
|
||||
{
|
||||
$ret.= "<tr>";
|
||||
if($table->foreignKeys[$attribute->attName])
|
||||
$fk= $table->foreignKeys[$attribute->attName]->target;
|
||||
else
|
||||
$fk= false;
|
||||
$attribute->size= strip_tags(nl2br($attribute->size));
|
||||
$ret.= "<td style='border-right: solid 1px #fff; height: 10px;'>".trim((($table->primaryKeys[$attribute->attName])? '*': (($fk)? '+': ' ')).$attribute->attName).'</td>';
|
||||
$ret.= "<td style='border-right: solid 1px #fff'>".trim($attribute->attType).'</td>';
|
||||
$ret.= "<td style='border-right: solid 1px #fff; text-align: center;'>".trim($attribute->size).'</td>';
|
||||
$ret.= "<td style='border-right: solid 1px #fff'>".trim((($attribute->attDefault)? (utf8_encode($attribute->attDefault)): 'NULL')).'</td>';
|
||||
$ret.= "<td style='border-right: solid 1px #fff; text-align: center;'>".trim((($attribute->nullAccepts)? 'NULL': 'NOT NULL')).'</td>';
|
||||
$ret.= "<td style='text-align: center;'>".(($fk)? $fk: '').'<br></td>';
|
||||
$ret.= "</tr>";
|
||||
}
|
||||
$ret.=' </table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
$ret.= '</div>';
|
||||
}
|
||||
$ret.= '</div>';
|
||||
}
|
||||
$ret.= '';
|
||||
}
|
||||
$header.= "";
|
||||
return $header.$ret;
|
||||
}
|
||||
public function __construct($n, $dir)
|
||||
{
|
||||
$this->projectName= $n;
|
||||
$this->configDirectory= $dir;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,296 @@
|
||||
<?php
|
||||
/**
|
||||
* Class that contains the methods to manipulate Modules
|
||||
* @filesource
|
||||
* @author Jaydson Gomes
|
||||
* @author Felipe Nascimento
|
||||
* @copyright Copyright <2009> TheWebMind.org
|
||||
* @package classes
|
||||
* @subpackage restrict.framework
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
$_FW= null; //@GLOBAL Mind Framework
|
||||
|
||||
class Module
|
||||
{
|
||||
public $name;
|
||||
public $version;
|
||||
public $fullName;
|
||||
public $language;
|
||||
public $details;
|
||||
public $authors;
|
||||
public $description;
|
||||
public $date;
|
||||
public $thumb;
|
||||
public $license;
|
||||
private $module;
|
||||
public $dependences; // scripts, styles and options the current module has/needs
|
||||
public $configPage;
|
||||
private $moduleData; // the options or additional information added to the loaded module
|
||||
|
||||
|
||||
public function pDir($d){
|
||||
GLOBAL $_FW;
|
||||
$_FW->pDir($d);
|
||||
}
|
||||
public function mDir($d)
|
||||
{
|
||||
GLOBAL $_FW;
|
||||
$_FW->mDir($d);
|
||||
}
|
||||
|
||||
protected function load($m)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
if($this->moduleExists($m))
|
||||
{
|
||||
$m= $_MIND['rootDir'].$_MIND['moduleDir'].'/'.$m.'/';
|
||||
if(($confXML= @simplexml_load_file($m.'conf.xml')) && $infoXML= @simplexml_load_file($m.'info.xml'))
|
||||
{
|
||||
// creating the info array
|
||||
$ar= Array();
|
||||
$ar['name']= (string)$infoXML->name['value'];
|
||||
$ar['fullName']= (string)$infoXML->fullName['value'];
|
||||
$ar['language']= (string)$infoXML->language['value'];
|
||||
$ar['details']= Array();
|
||||
foreach($infoXML->details->detail as $d)
|
||||
array_push($ar['details'], Array('name'=>(string)$d['name'], 'value'=>(string)$d['value']));
|
||||
$ar['authors']= Array();
|
||||
foreach($infoXML->authors->author as $d)
|
||||
array_push($ar['authors'], Array('name'=>(string)$d['value'], 'email'=>(string)$d['email']));
|
||||
//$ar['details']= $infoXML->details['value'];
|
||||
|
||||
$ar['version']= (string)$infoXML->version['value'];
|
||||
$ar['description']= (string)$infoXML->description['value'];
|
||||
$ar['date']= (string)$infoXML->date['value'];
|
||||
$ar['thumb']= (string)$infoXML->thumb['value'];
|
||||
$ar['license']= (string)$infoXML->license['value'];
|
||||
$ar['configPage']= (string)$confXML->config['src'];
|
||||
|
||||
// creating the config array
|
||||
$ar['dependences']= Array();
|
||||
$ar['dependences']['scripts']= Array();
|
||||
$ar['dependences']['styles']= Array();
|
||||
|
||||
foreach($confXML->scripts->js as $d)
|
||||
array_push($ar['dependences']['scripts'],
|
||||
(string)$d['src']);
|
||||
foreach($confXML->styles->css as $d)
|
||||
array_push($ar['dependences']['styles'],
|
||||
(string)$d['src']);
|
||||
|
||||
$this->populate($ar);
|
||||
//$this->populate($_MIND['fw']->objectToArray($infoXML));
|
||||
}else{
|
||||
echo "Mind.Dialog.ShowError(".JSON_encode($_MIND['fw']->errorOutput(7)).")";
|
||||
}
|
||||
}else{
|
||||
echo "Mind.Dialog.ShowError(".JSON_encode($_MIND['fw']->errorOutput(7)).")";
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function populate($ar)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$this->name = $_MIND['fw']->getEncoded($ar['name']);
|
||||
$d= $_MIND['moduleDir'].'/'.$this->name.'/data/';
|
||||
$this->version = $ar['version'];
|
||||
$this->fullName = $_MIND['fw']->filter($ar['fullName']);
|
||||
$this->language = $_MIND['fw']->filter($ar['language']);
|
||||
$this->description = $_MIND['fw']->filter($ar['description']);
|
||||
$this->date = $ar['date'];
|
||||
$this->thumb = $d.$_MIND['fw']->getEncoded($ar['thumb']);
|
||||
$this->license = $d.$_MIND['fw']->getEncoded($ar['license']);
|
||||
$this->authors = Array();
|
||||
for($i=0; $i<sizeof($ar['authors']); $i++)
|
||||
{
|
||||
$this->authors[$i]= $ar['authors'][$i];
|
||||
}
|
||||
$this->details = Array();
|
||||
for($i=0; $i<sizeof($ar['details']); $i++)
|
||||
{
|
||||
$this->details[$i]= Array('name'=>$ar['details'][$i]['name'], 'value'=>$ar['details'][$i]['value']);
|
||||
}
|
||||
$this->dependences = Array();
|
||||
if(isset($ar['dependences']))
|
||||
{
|
||||
if(isset($ar['dependences']['scripts']))
|
||||
for($i=0; $i<sizeof($ar['dependences']['scripts']); $i++)
|
||||
{
|
||||
$this->dependences['scripts'][$i]= $d.$_MIND['fw']->getEncoded($ar['dependences']['scripts'][$i]);
|
||||
}
|
||||
if(isset($ar['dependences']['styles']))
|
||||
for($i=0; $i<sizeof($ar['dependences']['styles']); $i++)
|
||||
{
|
||||
$this->dependences['styles'][$i]= $d.$_MIND['fw']->getEncoded($ar['dependences']['styles'][$i]);
|
||||
}
|
||||
}
|
||||
$this->configPage= $ar['configPage'];
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function moduleExists($m)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
return file_exists($_MIND['rootDir'].$_MIND['moduleDir'].'/'.$m.'/conf.xml');
|
||||
}
|
||||
|
||||
public function loadModule($p)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$mDir= $_MIND['rootDir'].$_MIND['moduleDir'].'/';
|
||||
include($mDir.'module_interface.php');
|
||||
include($mDir.$this->name.'/'.$this->name.'.php');
|
||||
$this->module= new $this->name($p);
|
||||
}
|
||||
|
||||
public function askForCRUD($tableObject)
|
||||
{
|
||||
$this->module->applyCRUD($tableObject);
|
||||
}
|
||||
|
||||
public function structure($m, $p)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$x= $this->module->getStructure();
|
||||
|
||||
if(trim($x)==''){
|
||||
return true;
|
||||
}
|
||||
|
||||
$m= $_MIND['rootDir'].$m.$x;
|
||||
$p= $_MIND['rootDir'].$p;
|
||||
|
||||
if(!$_MIND['fw']->copyDir($m, $p, true, true))
|
||||
return false;
|
||||
}
|
||||
|
||||
public function callExtra()
|
||||
{
|
||||
$this->module->callExtra();
|
||||
}
|
||||
|
||||
public function onFinish()
|
||||
{
|
||||
$this->module->onFinish();
|
||||
}
|
||||
|
||||
public function onStart()
|
||||
{
|
||||
$this->module->onStart();
|
||||
}
|
||||
|
||||
/**
|
||||
*Return the prefix name to Primary Key
|
||||
*@return String
|
||||
*/
|
||||
public function getPrefixNamePK(){
|
||||
GLOBAL $_MIND;
|
||||
return $_MIND['primaryKeyPrefix'];
|
||||
}
|
||||
|
||||
/**
|
||||
*Return the prefix name to Foreign Key
|
||||
*@return String
|
||||
*/
|
||||
public function getPrefixNameFK(){
|
||||
GLOBAL $_MIND;
|
||||
return $_MIND['foreignKeyPrefix'];
|
||||
}
|
||||
|
||||
/**
|
||||
*Set carriage tab in a text
|
||||
*@param int $tabs - Number of carriage tabs
|
||||
*@return String
|
||||
*/
|
||||
public function setTabText($tabs){
|
||||
$tab="";
|
||||
for($t=0;$t<$tabs;$t++){
|
||||
$tab.=" ";
|
||||
}
|
||||
return $tab;
|
||||
}
|
||||
|
||||
/**
|
||||
*Get the Query Script of an Table
|
||||
*@param String $command - INSERT,DELETE,UPDATE,SELECT
|
||||
*@param Table $table - Mind Table Object, that contais all knowledge
|
||||
*@return String
|
||||
*/
|
||||
public function getQueryScript($command,$table){
|
||||
$query = "";
|
||||
$fields = "";
|
||||
$attributes = $table->attributes;
|
||||
switch($command){
|
||||
case "INSERT" :
|
||||
$size=0;
|
||||
$count=0;
|
||||
$values="";
|
||||
reset($attributes);
|
||||
while($cur = current($attributes)){
|
||||
if(!$cur->pk)
|
||||
$size++;
|
||||
next($attributes);
|
||||
}
|
||||
reset($attributes);
|
||||
while($cur = current($attributes)){
|
||||
if(!$cur->pk){
|
||||
$count++;
|
||||
$values.= $count==$size ? "?" : "?,";
|
||||
$fields.= $count==$size ? $cur->name : $cur->name.",";
|
||||
}
|
||||
next($attributes);
|
||||
}
|
||||
$query = "INSERT INTO ". $table->name." (".$fields.") VALUES (".$values.")";
|
||||
return $query;
|
||||
break;
|
||||
|
||||
case "UPDATE" :
|
||||
$size=0;
|
||||
$count=0;
|
||||
reset($attributes);
|
||||
while($cur = current($attributes)){
|
||||
if(!$cur->pk){
|
||||
$comma = $count==0 ? "" : ",";
|
||||
$fields.= $comma.$cur->name."=?";
|
||||
$count++;
|
||||
}
|
||||
next($attributes);
|
||||
}
|
||||
$query = "UPDATE ". $table->name." SET ".$fields." WHERE pk_".$table->name."=?";
|
||||
return $query;
|
||||
break;
|
||||
|
||||
case "REMOVE" :
|
||||
$query = "DELETE FROM ". $table->name." WHERE pk_".$table->name."=?";
|
||||
return $query;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function getContent($file){
|
||||
GLOBAL $_FW;
|
||||
return $_FW->getContent($file);
|
||||
}
|
||||
|
||||
public function __construct($module= false)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
GLOBAL $_FW;
|
||||
|
||||
$this->authors = Array();
|
||||
$this->details = Array();
|
||||
$this->dependences = Array();
|
||||
|
||||
// includes the framework that will be used by the selected module
|
||||
include_once('fw.php');
|
||||
$_FW= new FW();
|
||||
if($module)
|
||||
{
|
||||
$this->load($module);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,272 @@
|
||||
<?php
|
||||
/**
|
||||
* Class related to Plugin Objects
|
||||
* @author Felipe Nascimento
|
||||
* @name Plugin
|
||||
* @package framework
|
||||
*/
|
||||
class Plugin
|
||||
{
|
||||
public $name= '';
|
||||
public $date= '';
|
||||
public $authors= Array();
|
||||
public $link= '';
|
||||
public $description= '';
|
||||
public $conf= '';
|
||||
public $dir= '';
|
||||
public $disabled = false;
|
||||
|
||||
public function code($c = false)
|
||||
{
|
||||
if($c)
|
||||
$this->name= $c;
|
||||
else
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
function conf($confName, $confValue=false)
|
||||
{
|
||||
if($confValue)
|
||||
{
|
||||
$this->conf[$confName]= $confValue;
|
||||
}else{
|
||||
return $this->conf[$confName];
|
||||
}
|
||||
}
|
||||
function name($n=false)
|
||||
{
|
||||
if($n)
|
||||
$this->name= $n;
|
||||
else
|
||||
return $this->name;
|
||||
}
|
||||
function date($n=false)
|
||||
{
|
||||
if($n)
|
||||
$this->date= $n;
|
||||
else
|
||||
return $this->date;
|
||||
}
|
||||
function authors($n=false)
|
||||
{
|
||||
if($n)
|
||||
$this->authors[]= $n;
|
||||
else
|
||||
return $this->authors;
|
||||
}
|
||||
function link($n=false)
|
||||
{
|
||||
if($n)
|
||||
$this->link= $n;
|
||||
else
|
||||
return $this->link;
|
||||
}
|
||||
function description($n=false)
|
||||
{
|
||||
if($n)
|
||||
$this->description= $n;
|
||||
else
|
||||
return $this->description;
|
||||
}
|
||||
function __construct($pluginName= false)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$dir= $_MIND['rootDir'];
|
||||
$this->dir= $_MIND['pluginDir'];
|
||||
if($pluginName)
|
||||
$this->load($pluginName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the information of one plugin
|
||||
* @name getPlugin
|
||||
* @param $cod the name of the plugins, itself
|
||||
* @return Plugin Object
|
||||
*/
|
||||
static function getPlugin($cod)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$d = dir($_MIND['rootDir'].$_MIND['pluginDir']);
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if($entry == $cod)
|
||||
{
|
||||
$pl= new Plugin($entry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
if(isset($pl))
|
||||
return $pl;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the list of plugins
|
||||
* @name getPlugins
|
||||
* @author Felipe Nacimento
|
||||
* @return Numeric Array of Plugin objects
|
||||
*/
|
||||
static function getPlugins()
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$dir= $_MIND['rootDir'];
|
||||
$d = dir($dir.$_MIND['pluginDir']);
|
||||
$ret= Array();
|
||||
$list= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if($entry != "." && $entry != ".." && $entry != ".svn" && is_dir($d->path)
|
||||
&& !isset($list[$entry]))
|
||||
{
|
||||
$ret[]= new Plugin($entry);
|
||||
$ret[sizeof($ret)-1]->code($ret[sizeof($ret)-1]->name());
|
||||
$list[$entry]= true;
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates the Plugin Object
|
||||
* @param $ar with the data to be used
|
||||
* @author Felipe Nascimento
|
||||
*/
|
||||
function populate($ar)
|
||||
{
|
||||
$this->code($ar['name']);
|
||||
$this->name($ar['name']);
|
||||
$this->date($ar['date']);
|
||||
$this->author($ar['author']);
|
||||
$this->link($ar['link']);
|
||||
$this->description($ar['description']);
|
||||
$this->conf['openAs']= $ar['openAs'];
|
||||
$this->conf['runAt']= $ar['runAt'];
|
||||
$this->conf['openEvent']= $ar['openEvent'];
|
||||
$this->conf['status']= $ar['status'];
|
||||
$this->conf['useIcon']= $ar['useIcon'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a specific plugin data (conf and info)
|
||||
* @param $plugin Object
|
||||
* @author Felipe Nascimento
|
||||
*/
|
||||
function load($plugin)
|
||||
{
|
||||
$flagActive = false;
|
||||
GLOBAL $_MIND;
|
||||
if(!file_exists($_MIND['rootDir'].$_MIND['pluginDir'].'/'.$plugin)){
|
||||
$plugin = ".".$plugin;
|
||||
$flagActive = true;
|
||||
}
|
||||
|
||||
if(file_exists($_MIND['rootDir'].$_MIND['pluginDir'].'/'.$plugin))
|
||||
{
|
||||
$conf= simplexml_load_file($_MIND['rootDir'].$_MIND['pluginDir'].'/'.$plugin.'/conf.xml');
|
||||
$info= simplexml_load_file($_MIND['rootDir'].$_MIND['pluginDir'].'/'.$plugin.'/info.xml');
|
||||
|
||||
$this->name= (string)$info->name['value'];
|
||||
$this->date= (string)$info->date['value'];
|
||||
foreach($info->authors->author as $aut)
|
||||
$this->authors[]= (string)$aut['value'];
|
||||
$this->link= (string)$info->link['value'];
|
||||
$this->description= (string)$info->description;
|
||||
|
||||
$this->conf['openAs']= (string)$conf->openas['value'];
|
||||
$this->conf['runAt']= (string)$conf->runAt['value'];
|
||||
$this->conf['extraConfFile']= (string)$conf->extraconffile['value'];
|
||||
$this->conf['version']= (string)$conf->version['value'];
|
||||
$this->conf['useIcon']= (string)$conf->useicon['value'];
|
||||
$this->conf['dependsOnProject']= (string)$conf->dependsonproject['value'];
|
||||
if($flagActive){
|
||||
$this->disabled = true;
|
||||
}else{
|
||||
$this->disabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the current situation of the instance
|
||||
* @param [$obj] Optionaly, you can send other object to save
|
||||
*/
|
||||
function save($obj=false)
|
||||
{
|
||||
$obj= ($obj)? $obj: $this;
|
||||
GLOBAL $_MIND;
|
||||
$dir= $_MIND['rootDir'].$_MIND['pluginDir'].'/'.$obj->name();
|
||||
if(!file_exists($dir))
|
||||
{
|
||||
mkdir($dir);
|
||||
}
|
||||
$confF= $dir.'/conf.xml';
|
||||
$infoF= $dir.'/info.xml';
|
||||
$conf= $_MIND['fw']->mkXML($confF);
|
||||
$info= $_MIND['fw']->mkXML($infoF);
|
||||
$info->addChild('name');
|
||||
$info->name['value']= $this->name();
|
||||
$info->addChild('date');
|
||||
$info->date['value']= $this->date();
|
||||
$info->addChild('author');
|
||||
$info->author['value']= $this->author();
|
||||
$info->addChild('link');
|
||||
$info->link['value']= $this->link();
|
||||
|
||||
$conf->addChild('openAs');
|
||||
$conf->openAs['value']= $this->conf['openAs'];
|
||||
$conf->addChild('runAt');
|
||||
$conf->runAt['value']= $this->conf['runAt'];
|
||||
$conf->addChild('openEvent');
|
||||
$conf->openEvent['value']= $this->conf['openEvent'];
|
||||
$conf->addChild('openEvent');
|
||||
$conf->openEvent['value']= $this->conf['openEvent'];
|
||||
$conf->addChild('useicon');
|
||||
$conf->useicon['value']= $this->conf['useIcon'];
|
||||
|
||||
$_MIND['fw']->saveXML($conf, $confF);
|
||||
$_MIND['fw']->saveXML($info, $infoF);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable a Plugin (Just add dot(".") in the begin of folder)
|
||||
* @name disable
|
||||
* @author Felipe Nascimento
|
||||
* @return void
|
||||
*/
|
||||
function disable(){
|
||||
GLOBAL $_MIND;
|
||||
$dir= $_MIND['rootDir'].$_MIND['pluginDir'].'/';
|
||||
rename($dir.$this->code(), $dir.".".$this->code());
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a Plugin (Delete the folder)
|
||||
* @name remove
|
||||
* @author Felipe Nascimento
|
||||
* @return boolean
|
||||
*/
|
||||
function remove(){
|
||||
GLOBAL $_MIND;
|
||||
$dir= $_MIND['rootDir'].$_MIND['pluginDir'].'/';
|
||||
if(!file_exists($dir))
|
||||
$dir= '.'.$dir;
|
||||
if(!file_exists($dir))
|
||||
return false;
|
||||
$_MIND['fw']->deleteDirectory($dir.$this->code());
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable a Plugin (Just remove the dot(".") in the begin of folder)
|
||||
* @name enable
|
||||
* @author Felipe Nascimento
|
||||
* @return void
|
||||
*/
|
||||
function enable(){
|
||||
GLOBAL $_MIND;
|
||||
$dir= $_MIND['rootDir'].$_MIND['pluginDir'].'/';
|
||||
rename($dir.".".$this->code(), $dir.$this->code());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,598 @@
|
||||
<?php
|
||||
/*
|
||||
CLass: Project 1.0
|
||||
Definition: class used to manage the Project information.
|
||||
Author: Felipe Nascimento
|
||||
|
||||
Observations:
|
||||
* always save BEFORE processing
|
||||
*/
|
||||
class Project
|
||||
{
|
||||
public $name;
|
||||
public $lang;
|
||||
public $dbms;
|
||||
public $description;
|
||||
public $environment;
|
||||
public $users;
|
||||
public $owner;
|
||||
public $date;
|
||||
public $email;
|
||||
public $processed;
|
||||
public $version;
|
||||
public $knowledge;
|
||||
public $ddl;
|
||||
public $maskedDDL;
|
||||
public $dbmsObj;
|
||||
public $fkDDL= Array();
|
||||
public $wml; // WebMindLanguage
|
||||
|
||||
static function getProjects($usr)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$d = dir($_MIND['rootDir'].$_MIND['userDir'].'/'.$usr.'/temp');
|
||||
$c=0;
|
||||
$ar= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0, 1) != '.' && is_dir($_MIND['rootDir'].$_MIND['userDir'].'/'.$usr.'/temp/'.$entry))
|
||||
{
|
||||
$ar[$c]= new Project($entry);
|
||||
}
|
||||
$c++;
|
||||
}
|
||||
$d->close();
|
||||
if($c==0)
|
||||
return false;
|
||||
else
|
||||
return $ar;
|
||||
}
|
||||
static function getProject($cod, $usr)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$d = dir($_MIND['rootDir'].$_MIND['userDir'].'/'.$usr.'/temp');
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0, 1) != '.')
|
||||
{
|
||||
if($entry == $cod)
|
||||
{
|
||||
$p= new Project($entry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
if($p)
|
||||
return $p;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
static function projectExists($cod)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
return file_exists($_MIND['rootDir'].$_MIND['publishDir'].'/'.$cod);
|
||||
}
|
||||
function save()
|
||||
{// atualiza ou cria os arquivos referentes ao projeto, no diretório do usuario
|
||||
GLOBAL $_MIND;
|
||||
$this->name= str_replace(' ', '_', $_MIND['fw']->getEncoded($this->name));
|
||||
|
||||
$publishDir= $_MIND['rootDir'].$_MIND['publishDir'].'/'.$this->name;
|
||||
if($this->projectExists($this->name))
|
||||
{// atualiza
|
||||
$creating= false;
|
||||
$publConfF= $_MIND['fw']->mkXML($_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$this->name.'/conf.xml');
|
||||
$publInfoF= $_MIND['fw']->mkXML($_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$this->name.'/info.xml');
|
||||
$WebMindLanguage= $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$this->name.'/mind/mind_code.php';
|
||||
}else{// cria
|
||||
$creating= true;
|
||||
@mkdir($publishDir);
|
||||
@mkdir($publishDir.'/mind');
|
||||
@mkdir($publishDir.'/root');
|
||||
@mkdir($publishDir.'/root/documentation');
|
||||
$WebMindLanguage= $publishDir.'/mind/mind_code.php';
|
||||
$f= fopen($WebMindLanguage, 'w+'); fclose($f);
|
||||
$publConfF= $_MIND['fw']->mkXML($publishDir.'/conf.xml');
|
||||
$publInfoF= $_MIND['fw']->mkXML($publishDir.'/info.xml');
|
||||
}
|
||||
|
||||
$publConfF->addChild('name');
|
||||
$publConfF->name['value']= $this->name;
|
||||
$publConfF->addChild('date');
|
||||
$publConfF->date['value']= @date('m/d/Y - H:i:s');
|
||||
$publConfF->addChild('owner');
|
||||
$publConfF->owner['value']= $_SESSION['user']['login'];
|
||||
$publConfF->addChild('processed');
|
||||
$publConfF->processed['value']= ($this->processed)? 'true':'false';
|
||||
|
||||
$publConfF->addChild('version');
|
||||
$publConfF->version['value']= $this->version[0];
|
||||
$publConfF->addChild('subVersion');
|
||||
$publConfF->subVersion['value']= $this->version[1];
|
||||
$publConfF->addChild('update');
|
||||
$publConfF->update['value']= $this->version[2];
|
||||
|
||||
$publConfF->addChild('lang');
|
||||
$publConfF->lang['value']= $this->lang;
|
||||
$publConfF->addChild('dbms');
|
||||
$publConfF->dbms['value']= $this->dbms;
|
||||
$publConfF->addChild('users');
|
||||
$c=0;
|
||||
foreach($this->users as $u)
|
||||
{
|
||||
$publConfF->users->addChild('user');
|
||||
$publConfF->users->user[$c]['login']= $u;
|
||||
$c++;
|
||||
}
|
||||
|
||||
$publConfF->addChild('environment');
|
||||
$publConfF->environment->addChild('development');
|
||||
$publConfF->environment->development['dbAddress'] = $this->environment['development']['dbAddress'];
|
||||
$publConfF->environment->development['dbName'] = $this->environment['development']['dbName'];
|
||||
$publConfF->environment->development['dbPort'] = $this->environment['development']['dbPort'];
|
||||
$publConfF->environment->development['rootUser'] = $this->environment['development']['rootUser'];
|
||||
$publConfF->environment->development['rootUserPwd'] = $_MIND['fw']->encrypt($this->environment['development']['rootUserPwd']);
|
||||
$publConfF->environment->development['user'] = $this->environment['development']['user'];
|
||||
$publConfF->environment->development['userPwd'] = $_MIND['fw']->encrypt($this->environment['development']['userPwd']);
|
||||
|
||||
$publConfF->environment->addChild('production');
|
||||
$publConfF->environment->production['dbAddress'] = $this->environment['production']['dbAddress'];
|
||||
$publConfF->environment->production['dbName'] = $this->environment['production']['dbName'];
|
||||
$publConfF->environment->production['dbPort'] = $this->environment['production']['dbPort'];
|
||||
$publConfF->environment->production['rootUser'] = $this->environment['production']['rootUser'];
|
||||
$publConfF->environment->production['rootUserPwd'] = $_MIND['fw']->encrypt($this->environment['production']['rootUserPwd']);
|
||||
$publConfF->environment->production['user'] = $this->environment['production']['user'];
|
||||
$publConfF->environment->production['userPwd'] = $_MIND['fw']->encrypt($this->environment['production']['userPwd']);
|
||||
|
||||
$publInfoF->addChild('description', $this->description);
|
||||
$publInfoF->addChild('email');
|
||||
$publInfoF->email['value']= $this->email;
|
||||
if($creating)
|
||||
{
|
||||
$_MIND['fw']->saveXML($publConfF, $publishDir.'/conf.xml');
|
||||
$_MIND['fw']->saveXML($publInfoF, $publishDir.'/info.xml');
|
||||
foreach($this->users as $u)
|
||||
{
|
||||
$userDir = $_MIND['rootDir'].$_MIND['userDir'].'/'.$u.'/temp/'.$this->name;
|
||||
if(!@$_MIND['fw']->copyDir($publishDir, $userDir))
|
||||
{
|
||||
echo "Mind.Dialog.ShowError(".JSON_encode($_MIND['fw']->errorOutput(1)).")";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$_MIND['fw']->saveXML($publConfF, $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$this->name.'/conf.xml');
|
||||
$_MIND['fw']->saveXML($publInfoF, $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$this->name.'/info.xml');
|
||||
}
|
||||
|
||||
file_put_contents($WebMindLanguage, $this->wml);
|
||||
return true;
|
||||
}
|
||||
|
||||
function preparePost($p)
|
||||
{
|
||||
$p['environment']= Array();
|
||||
$p['environment']['development']= Array();
|
||||
$p['environment']['development']['dbAddress']= $p['dbAddress1'];
|
||||
$p['environment']['development']['dbName']= $p['dbName1'];
|
||||
$p['environment']['development']['dbPort']= $p['port1'];
|
||||
$p['environment']['development']['rootUser']= $p['userRoot1'];
|
||||
$p['environment']['development']['rootUserPwd']= $p['userRootPwd1'];
|
||||
$p['environment']['development']['user']= $p['user1'];
|
||||
$p['environment']['development']['userPwd']= $p['userPwd1'];
|
||||
$p['environment']['production']= Array();
|
||||
$p['environment']['production']['dbAddress'] = $p['dbAddress2'];
|
||||
$p['environment']['production']['dbName'] = $p['dbName2'];
|
||||
$p['environment']['production']['dbPort'] = $p['port2'];
|
||||
$p['environment']['production']['rootUser'] = $p['userRoot2'];
|
||||
$p['environment']['production']['rootUserPwd'] = $p['userRootPwd2'];
|
||||
$p['environment']['production']['user'] = $p['user2'];
|
||||
$p['environment']['production']['userPwd'] = $p['userPwd2'];
|
||||
return $p;
|
||||
}
|
||||
|
||||
function remove($projectName)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
if($this->hasProject($projectName))
|
||||
{
|
||||
$dir = $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/';
|
||||
$dirP = $_MIND['rootDir'].$_MIND['publishDir']."/";
|
||||
if(file_exists($dirP.".".$projectName)){
|
||||
$_MIND["fw"]->deleteDirectory($dir.".".$projectName);
|
||||
$_MIND["fw"]->deleteDirectory($dirP.".".$projectName);
|
||||
}
|
||||
rename($dir.$projectName, $dir.".".$projectName);
|
||||
rename($dirP.$projectName, $dirP.".".$projectName);
|
||||
echo "success";
|
||||
}else{
|
||||
echo "Mind.Dialog.ShowError(".JSON_encode($_MIND['fw']->errorOutput(5)).")";
|
||||
}
|
||||
}
|
||||
function populate($ar)
|
||||
{
|
||||
//GLOBAL $_MIND;
|
||||
if(isset($ar['name'])) $this->name = $ar['name'];
|
||||
if(isset($ar['lang'])) $this->lang = $ar['lang'];
|
||||
if(isset($ar['dbms'])) $this->dbms = $ar['dbms'];
|
||||
if(isset($ar['description'])) $this->description = $ar['description'];
|
||||
if(isset($ar['wml'])) $this->wml = $ar['wml'];
|
||||
if(isset($ar['environment']['development']))
|
||||
{
|
||||
$this->environment['development']['dbAddress'] = $ar['environment']['development']['dbAddress'];
|
||||
$this->environment['development']['dbName'] = $ar['environment']['development']['dbName'];
|
||||
$this->environment['development']['dbPort'] = $ar['environment']['development']['dbPort'];
|
||||
$this->environment['development']['rootUser'] = $ar['environment']['development']['rootUser'];
|
||||
$this->environment['development']['rootUserPwd']= $ar['environment']['development']['rootUserPwd'];
|
||||
$this->environment['development']['user'] = $ar['environment']['development']['user'];
|
||||
$this->environment['development']['userPwd'] = $ar['environment']['development']['userPwd'];
|
||||
}
|
||||
|
||||
if(isset($ar['environment']['production']))
|
||||
{
|
||||
$this->environment['production']['dbAddress'] = $ar['environment']['production']['dbAddress'];
|
||||
$this->environment['production']['dbName'] = $ar['environment']['production']['dbName'];
|
||||
$this->environment['production']['dbPort'] = $ar['environment']['production']['dbPort'];
|
||||
$this->environment['production']['rootUser'] = $ar['environment']['production']['rootUser'];
|
||||
$this->environment['production']['rootUserPwd'] = $ar['environment']['production']['rootUserPwd'];
|
||||
$this->environment['production']['user'] = $ar['environment']['production']['user'];
|
||||
$this->environment['production']['userPwd'] = $ar['environment']['production']['userPwd'];
|
||||
}
|
||||
|
||||
if(isset($ar['users'])) $users= $ar['users']; else $users= false;
|
||||
|
||||
if(@is_array($users))
|
||||
{
|
||||
foreach($users as $u)
|
||||
{
|
||||
if(User::userExists($u))
|
||||
if(!in_array($u, $this->users))
|
||||
$this->users[]= $u;
|
||||
}
|
||||
}else{
|
||||
}
|
||||
|
||||
if(!isset($ar['version']))
|
||||
$ar['version']= '0,0,1';
|
||||
elseif(is_array($ar['version']))
|
||||
$ar['version']= implode(',', $ar['version']);
|
||||
if(strstr($ar['version'], ','))
|
||||
{
|
||||
$ar['version']= explode(',', $ar['version']);
|
||||
$ar['subVersion']= $ar['version'][1];
|
||||
$ar['update']= $ar['version'][2];
|
||||
$ar['version']= $ar['version'][0];
|
||||
}
|
||||
|
||||
if(isset($ar['version']))
|
||||
$this->version[0]= $ar['version'];
|
||||
if(isset($ar['subVersion']))
|
||||
$this->version[1]= $ar['subVersion'];
|
||||
if(isset($ar['update']))
|
||||
$this->version[2]= $ar['update'];
|
||||
}
|
||||
public function saveAsWML()
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$fileToSave= $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$this->name.'/mind/'.$this->name.'_'.(date('m-d-Y')).'.wml';
|
||||
if(file_exists($fileToSave))
|
||||
unlink($fileToSave);
|
||||
if(!@fopen($fileToSave, 'w+'))
|
||||
echo "Mind.Dialog.ShowError(".JSON_encode($_MIND['fw']->errorOutput(9)).")";
|
||||
else
|
||||
file_put_contents($fileToSave, '<?wml version="1.0"?>
|
||||
'.$this->wml);
|
||||
}
|
||||
static function hasProject($prj)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
return file_exists($_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$prj);
|
||||
}
|
||||
function load($prj)
|
||||
{// carrega e popula o objeto com as informações do objeto
|
||||
GLOBAL $_MIND;
|
||||
$dirToLoad= $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/';
|
||||
if(!file_exists($_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$this->name))
|
||||
{
|
||||
echo "Mind.Dialog.ShowError(".JSON_encode($_MIND['fw']->errorOutput(2)).")";
|
||||
exit;
|
||||
}
|
||||
$info= $_MIND['fw']->loadXML($dirToLoad.$prj.'/info.xml');
|
||||
$conf= $_MIND['fw']->loadXML($dirToLoad.$prj.'/conf.xml');
|
||||
$this->name= (string)$conf->name['value'];
|
||||
$this->date= (string)$conf->date['value'];
|
||||
$this->email= (string)$info->email['value'];
|
||||
$this->owner= (string)$conf->owner['value'];
|
||||
$this->lang= (string)$conf->lang['value'];
|
||||
$this->dbms= (string)$conf->dbms['value'];
|
||||
$this->processed= (string)$conf->processed['value'];
|
||||
$this->description= (string)$info->description;
|
||||
|
||||
$this->version= Array();
|
||||
$this->version[0]= (integer)$conf->version['value'];
|
||||
$this->version[1]= (integer)$conf->subVersion['value'];
|
||||
$this->version[2]= (integer)$conf->update['value'];
|
||||
|
||||
$this->environment= Array();
|
||||
$this->wml= file_get_contents($dirToLoad.$prj.'/mind/mind_code.php');
|
||||
$this->originalWML= $this->wml;
|
||||
|
||||
foreach($conf->environment->development->attributes() as $a => $b)
|
||||
{
|
||||
$this->environment['development'][$a]= (string)$b;
|
||||
}
|
||||
$this->environment['development']['rootUserPwd']= $_MIND['fw']->decrypt($this->environment['development']['rootUserPwd']);
|
||||
$this->environment['development']['userPwd']= $_MIND['fw']->decrypt($this->environment['development']['rootUserPwd']);
|
||||
foreach($conf->environment->production->attributes() as $a => $b)
|
||||
{
|
||||
$this->environment['production'][$a]= (string)$b;
|
||||
}
|
||||
$this->environment['production']['rootUserPwd']= $_MIND['fw']->decrypt($this->environment['production']['rootUserPwd']);
|
||||
$this->environment['production']['userPwd']= $_MIND['fw']->decrypt($this->environment['production']['rootUserPwd']);
|
||||
|
||||
$this->users= Array();
|
||||
foreach($conf->users->user as $tmpUser)
|
||||
{
|
||||
$this->users[]= (string)$tmpUser['login'];
|
||||
}
|
||||
if(!isset($_SESSION['current']))
|
||||
$_SESSION['current']= Array();
|
||||
$_SESSION['current']['lang']= $this->lang;
|
||||
$_SESSION['current']['dbms']= $this->dbms;
|
||||
$_SESSION['current']['name']= $this->name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
function process()
|
||||
{
|
||||
include('mind_processor.php');
|
||||
$m= new MindProcessor($this);
|
||||
$this->knowledge= $m;
|
||||
return true;
|
||||
}
|
||||
|
||||
function run()
|
||||
{
|
||||
$time= microtime();
|
||||
if($this->process())
|
||||
{
|
||||
$this->generateQueries();
|
||||
|
||||
unset($this->knowledge->especialChars);
|
||||
unset($this->knowledge->fixedChars);
|
||||
unset($this->knowledge->relations);
|
||||
unset($this->knowledge->tmpSentences);
|
||||
unset($this->knowledge->processedWML);
|
||||
unset($this->knowledge->unique);
|
||||
unset($this->knowledge->required);
|
||||
unset($this->knowledge->verbId);
|
||||
unset($this->knowledge->quantifierId);
|
||||
unset($this->knowledge->quantifiers);
|
||||
|
||||
$this->saveAsWML();
|
||||
|
||||
$this->knowledge->DDL= $this->maskedDDL;
|
||||
|
||||
$time= microtime() - $time;
|
||||
$this->knowledge->processTime= $time;
|
||||
|
||||
$this->knowledge->debug['messages'][]= Array(4,
|
||||
"Finished at ".(date('m/d/Y H:i:s')).' - User: '.$_SESSION['user']['login'].'<br/>'.
|
||||
" ".$this->lang.' '. sizeof($this->knowledge->tables).
|
||||
" tables ".sizeof($this->knowledge->sentences).' sentences'.
|
||||
' in '.$time.' seconds');
|
||||
$this->knowledge->debug['processTime']= $time;
|
||||
$this->knowledge->debug['status']= '1';
|
||||
//$this->knowledge->debug['messages']= Array();
|
||||
|
||||
return $this->knowledge;
|
||||
}else{
|
||||
echo JSON_encode($_MIND['fw']->errorOutput(3));
|
||||
}
|
||||
}
|
||||
function debug()
|
||||
{
|
||||
/*
|
||||
1-envia o codigo para o mind interpretar, e retornar o codigo inalizado
|
||||
2-abre modal pane exibindo o debug do codigo, insinuando o que e como o mind interpretará o mesmo, quando for rodar
|
||||
*/
|
||||
}
|
||||
function execute()
|
||||
{// link para a ultima versão gerada
|
||||
}
|
||||
function publish() // generate Version
|
||||
{// salva no diretorio dos projetos
|
||||
/*
|
||||
1-caso o usuario for o criador do projeto, verificar se o projeto tem alterações nas conf e info, para salvar antes(caso tenha, confirmar ação)
|
||||
2-verificar se o codigo foi alterado desde a ultima vez em que foi rodado, se sim, roda-lo
|
||||
3-copiar o projeto do diretorio de projetos para um backup
|
||||
4-criar um log com dados do usuario que gerou a ultima vez, horario, ip, etc
|
||||
5-enviar o projeto do diretorio temp do usuario para o diretorio dos projetos, alterando o terceiro dado da versao (z.y.x+1)
|
||||
*/
|
||||
}
|
||||
function export($onlyDDL= false)
|
||||
{// cria um arquivo e coloca para download com a extensao .mnd
|
||||
GLOBAL $_MIND;
|
||||
$this->process();
|
||||
header('Content-type: package/mnd');
|
||||
if($onlyDDL)
|
||||
header('Content-Disposition: attachment; filename="'.trim($this->name).'.sql"');
|
||||
else
|
||||
header('Content-Disposition: attachment; filename="'.trim($this->name).'.mnd"');
|
||||
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
|
||||
|
||||
if($onlyDDL)
|
||||
{
|
||||
echo $_SESSION['currentDDL'];
|
||||
exit;
|
||||
}
|
||||
|
||||
echo $_MIND['wmlVersion'][$_MIND['wmlCurrentVersion']].'
|
||||
';
|
||||
$ar= Array();
|
||||
$ar['wml']= $this->wml;
|
||||
|
||||
unset ($this->wml);
|
||||
unset ($this->knowledge);
|
||||
unset ($this->maskedDDL);
|
||||
unset ($this->ddl);
|
||||
|
||||
$ar['projectData']= $_MIND['fw']->objectToArray($this);
|
||||
$ar['originalWML']= $_MIND['fw']->fixName($this->originalWML);
|
||||
|
||||
echo JSON_encode($ar);
|
||||
|
||||
exit;
|
||||
}
|
||||
function import()
|
||||
{// carrega um arquivo para criar o projeto
|
||||
// se o projeto ja existir no diretorio de projetos do usuario q está importando, deverá sobrescrever o mesmo, apos uma confirmação.
|
||||
// senao
|
||||
// se o projeto ja existe no diretorio global de projetos
|
||||
// retorna um erro para o usuario, informando q o projeto ja existe e que ele nao tem permissoes para substituí-lo
|
||||
// senao, cria um novo projeto colocando o usuario atual como criador.
|
||||
}
|
||||
function __construct($pName=false, $pUser=false)
|
||||
{
|
||||
if($pName)
|
||||
$this->name= $pName;
|
||||
$this->environment= Array();
|
||||
$this->environment['development']= Array();
|
||||
$this->environment['production']= Array();
|
||||
$this->users= Array();
|
||||
$this->processed= false;
|
||||
$this->email= $_SESSION['user']['email'];
|
||||
$this->owner=$_SESSION['user']['login'];
|
||||
$this->version= Array();
|
||||
$this->version[0]= 0;
|
||||
$this->version[1]= 0;
|
||||
$this->version[2]= 1;
|
||||
$this->originalWML= '';
|
||||
$this->wml= '';
|
||||
|
||||
if($pUser && $pName)
|
||||
{
|
||||
$this->load($pName, $pUser);
|
||||
}
|
||||
}
|
||||
|
||||
// GENERATING QUERIES
|
||||
public function generateQueries()
|
||||
{
|
||||
if($this->knowledge)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$dbmsDir= $_MIND['rootDir'].$_MIND['dbmsDir'];
|
||||
//echo $dbmsDir;
|
||||
include($dbmsDir.'/dbms_interface.php');
|
||||
include($dbmsDir.'/'.$this->dbms.'/'.$this->dbms.'.php');
|
||||
$this->dbmsObj= new $this->dbms;
|
||||
$dbms= &$this->dbmsObj;
|
||||
|
||||
$dbms= new $this->dbms;
|
||||
$this->ddl= strip_tags($dbms->getHeader());
|
||||
$tables= $this->knowledge->tables;
|
||||
$this->maskedDDL= $dbms->getHeader();
|
||||
$fkDDL= '';
|
||||
foreach($tables as $table)
|
||||
{
|
||||
$tmpDDL= $dbms->createTable();
|
||||
$tmpDDL= preg_replace('/<tablename>/', $table->name, $tmpDDL);
|
||||
$c= 0;
|
||||
$attDDL= '';
|
||||
foreach($table->attributes as $att)
|
||||
{
|
||||
$tmpAttDDL= '';
|
||||
if($c==0)
|
||||
{
|
||||
$pk= $att;
|
||||
$tmpAttDDL.= $dbms->defaultPrimaryKey();
|
||||
$tmpAttDDL= preg_replace('/<fieldname>/', trim($att->name), $tmpAttDDL);
|
||||
$tmpAttDDL= ' '.preg_replace('/<tablename>/', trim($table->name), $tmpAttDDL);
|
||||
$tmpAttDDL.= ',
|
||||
';
|
||||
}else{
|
||||
$tmpType= preg_replace('/<length>/',
|
||||
$att->size,
|
||||
$dbms->attType[$att->type]);
|
||||
|
||||
$tmpAttDDL= preg_replace('/<fieldname>/', trim($att->name), ' '.trim($dbms->createField()).',
|
||||
');
|
||||
$tmpAttDDL= preg_replace('/<fieldtype>/', $tmpType, $tmpAttDDL);
|
||||
if(trim($att->defaultValue) != '')
|
||||
{
|
||||
$tmpAttDDL= preg_replace('/<defaultvalue>/', preg_replace('/<defaultvalue>/', $att->defaultValue, $dbms->setDefaultValue()), $tmpAttDDL);
|
||||
}else{
|
||||
$tmpAttDDL= preg_replace('/<defaultvalue>/', preg_replace('/<defaultvalue>/', "", ''), $tmpAttDDL);
|
||||
}
|
||||
$tmpAttDDL= preg_replace('/<allownull>/', (($att->required)? 'not null': ''), $tmpAttDDL);
|
||||
}
|
||||
$attDDL.= $tmpAttDDL;
|
||||
$c++;
|
||||
}
|
||||
foreach($table->foreignKeys as $fk)
|
||||
{
|
||||
$tmpAttDDL= preg_replace('/<fieldname>/', $fk[0], ' '.trim($dbms->createField()).',
|
||||
');
|
||||
$tmpAttDDL= preg_replace('/<fieldtype>/', $dbms->attType['integer'], $tmpAttDDL);
|
||||
$attDDL.= $tmpAttDDL;
|
||||
}
|
||||
$attDDL.= ' '.preg_replace('/<pk>/', $pk->name, $dbms->createPK());
|
||||
$tmpDDL= preg_replace('/<fields>/', $attDDL, $tmpDDL).'
|
||||
|
||||
';
|
||||
$this->ddl.= '
|
||||
'.strip_tags($tmpDDL);
|
||||
|
||||
$this->knowledge->tables[$table->name]->DDL= strip_tags($tmpDDL);
|
||||
|
||||
$this->maskedDDL.= preg_replace('/( +),/', ',', $tmpDDL);
|
||||
foreach($table->foreignKeys as $fk)
|
||||
{
|
||||
$tmpFK= preg_replace('/<table>/', $table->name, $dbms->createFK());
|
||||
$tmpFK= preg_replace('/<references>/', $fk[1], $tmpFK);
|
||||
$tmpFK= preg_replace('/<references_pk>/', $_MIND['primaryKeyPrefix'].$fk[1], $tmpFK);
|
||||
$tmpFK= preg_replace('/<fk>/', $fk[0], $tmpFK);
|
||||
$this->fkDDL[]= strip_tags($tmpFK);
|
||||
$fkDDL.= $tmpFK.'
|
||||
';
|
||||
}
|
||||
$tmp= Array();
|
||||
reset($table->refered);
|
||||
$c= 0;
|
||||
while($cur= current($table->refered))
|
||||
{
|
||||
if($cur == $table->name.'|'.$table->name)
|
||||
$tmp[]= $c;
|
||||
next($table->refered);
|
||||
$c++;
|
||||
}
|
||||
for($i=0; $i<sizeof($tmp); $i++)
|
||||
{
|
||||
unset($table->refered[$tmp[$i]]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->maskedDDL.= '
|
||||
<mindComment>/* Adding Foreign Keys */</mindComment>
|
||||
'.$fkDDL;
|
||||
$this->ddl.= '
|
||||
/* Adding Foreign Keys */
|
||||
'.strip_tags($fkDDL);
|
||||
$this->maskedDDL= preg_replace('/<constructor>/', "<span class='ddl_code_constructor'>", $this->maskedDDL);
|
||||
$this->maskedDDL= preg_replace('/<\/constructor>/', "</span>", $this->maskedDDL);
|
||||
$this->maskedDDL= preg_replace('/<element>/', "<span class='ddl_code_element'>", $this->maskedDDL);
|
||||
$this->maskedDDL= preg_replace('/<\/element>/', "</span>", $this->maskedDDL);
|
||||
$this->maskedDDL= preg_replace('/<obj>/', "<span class='ddl_code_obj'>", $this->maskedDDL);
|
||||
$this->maskedDDL= preg_replace('/<\/obj>/', "</span>", $this->maskedDDL);
|
||||
$this->maskedDDL= preg_replace('/<objTable>/', '<span class="ddl_code_objTable">', $this->maskedDDL);
|
||||
$this->maskedDDL= preg_replace('/<\/objTable>/', "</span>", $this->maskedDDL);
|
||||
$this->maskedDDL= preg_replace('/<mindComment>/', "<span class='ddl_code_mindComment'>", $this->maskedDDL);
|
||||
$this->maskedDDL= preg_replace('/<\/mindComment>/', "</span>", $this->maskedDDL);
|
||||
}
|
||||
$_SESSION['currentDDL']= $this->ddl;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
class Relation
|
||||
{
|
||||
public $name;
|
||||
public $leftTable;
|
||||
public $rightTable;
|
||||
|
||||
public function __construct($rName= false)
|
||||
{
|
||||
if($rName)
|
||||
$this->name= $rName;
|
||||
if(strpos($rName, '|'))
|
||||
{
|
||||
$this->leftTable= explode('|', $rName);
|
||||
$this->rightTable= $this->leftTable[1];
|
||||
$this->leftTable= $this->leftTable[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
interface sgbdInterface
|
||||
{
|
||||
/*public function newPK(); // must return the value to be inserted on Primary Keys
|
||||
public function insert(); //
|
||||
public function update(); //
|
||||
public function select(); //
|
||||
public function delete(); //
|
||||
public function create(); // */
|
||||
}
|
||||
class SGBD// implements sgbdInterface
|
||||
{
|
||||
public $name= '';
|
||||
public $sqlBase= '';
|
||||
public $execute= '';
|
||||
|
||||
public function createTable($con, $tb)
|
||||
{
|
||||
echo " >>>>>>>>>>>>>>>>> CRIANDO A TABELA ".$tb->name;
|
||||
$this->execute->query($con, $tb->DDL);
|
||||
return $this->execute->query($con, $tb->DDL);
|
||||
}
|
||||
|
||||
public function __construct($SGBD)
|
||||
{
|
||||
$this->name= $SGBD;
|
||||
include('sgbds/'.$SGBD.'.php');
|
||||
$this->execute= new $SGBD();
|
||||
}
|
||||
public function getSGBD()
|
||||
{
|
||||
return $this->execute;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class SubType
|
||||
{
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
include('attribute.php');
|
||||
class Table
|
||||
{
|
||||
public $name;
|
||||
public $attributes= Array();
|
||||
public $refered= Array();
|
||||
public $weight= 0;
|
||||
public $foreignKeys= Array();
|
||||
public $abstract= false;
|
||||
public $extends= false;
|
||||
public $DDL= false;
|
||||
|
||||
public function addAttribute($att)
|
||||
{
|
||||
if(is_string($att)) // the name of the attribute
|
||||
{
|
||||
$this->attributes[$att]= new Attribute($att);
|
||||
return $this->attributes[$att];
|
||||
}else{ // the attribute object itself, has been received
|
||||
$this->attributes[$att->name]= $att;
|
||||
}
|
||||
return $this->attributes[$att->name];
|
||||
}
|
||||
public function removeReference($refName)
|
||||
{
|
||||
for($i=0; $i<sizeof($this->refered); $i++)
|
||||
{
|
||||
if(isset($this->refered[$i]))
|
||||
if($this->refered[$i]== $refName)
|
||||
{
|
||||
unset($this->refered[$i]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
public function removeForeignKey($fk)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
for($i=0; $i<sizeof($this->foreignKeys); $i++)
|
||||
{
|
||||
if($this->foreignKeys[$i][1]== $fk)
|
||||
{
|
||||
unset($this->foreignKeys[$i]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
public function addForeignKey($table, $p= false)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$fkName= ($p)? $p: $_MIND['foreignKeyPrefix'];
|
||||
$fkName.= $table;
|
||||
//echo $fkName.'<hr/>';
|
||||
$this->foreignKeys[]= Array($fkName, $table);
|
||||
}
|
||||
public function __construct($tName=false)
|
||||
{
|
||||
if($tName)
|
||||
$this->name= $tName;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,248 @@
|
||||
<?php
|
||||
class User
|
||||
{
|
||||
public $name= "";
|
||||
public $code= "";
|
||||
public $login= "";
|
||||
public $pwd= '';
|
||||
public $status= '1';
|
||||
public $age= '0';
|
||||
public $email= "";
|
||||
public $description= "";
|
||||
public $position= "";
|
||||
|
||||
function code()
|
||||
{
|
||||
if(isset($n))
|
||||
$this->code= $n;
|
||||
else
|
||||
return $this->login;
|
||||
}
|
||||
function name($n=false)
|
||||
{
|
||||
if($n)
|
||||
$this->name= $n;
|
||||
else
|
||||
return $this->name;
|
||||
}
|
||||
function login($n=false)
|
||||
{
|
||||
if($n)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$this->login= $_MIND['fw']->getEncoded($n);
|
||||
}else
|
||||
return $this->login;
|
||||
}
|
||||
function pwd($n=false)
|
||||
{
|
||||
if($n)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$this->pwd= $_MIND['fw']->getEncodedPwd($n);
|
||||
}else
|
||||
return $this->pwd;
|
||||
}
|
||||
function status($n=false)
|
||||
{
|
||||
if($n!==false)
|
||||
$this->status= ($n==0)? '0': '1';
|
||||
else
|
||||
return $this->status;
|
||||
}
|
||||
function age($n=false)
|
||||
{
|
||||
if($n && is_numeric($n))
|
||||
$this->age= $n;
|
||||
else
|
||||
return $this->age;
|
||||
}
|
||||
function email($n=false)
|
||||
{
|
||||
if($n)
|
||||
$this->email= $n;
|
||||
else
|
||||
return $this->email;
|
||||
}
|
||||
function description($n=false)
|
||||
{
|
||||
if($n)
|
||||
$this->description= $n;
|
||||
else
|
||||
return $this->description;
|
||||
}
|
||||
function position($n=false)
|
||||
{
|
||||
if($n)
|
||||
$this->position= $n;
|
||||
else
|
||||
return $this->position;
|
||||
}
|
||||
function loadUser($l, $p)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$dir= $_MIND['rootDir'];
|
||||
$l= $_MIND['fw']->getEncoded($l);
|
||||
$p= $_MIND['fw']->getEncodedPwd($p);
|
||||
$cF= $_MIND['userDir'].'/'.$l.'/'.$_MIND['userConfFile'].'.xml';
|
||||
if(!file_exists($cF))
|
||||
$bg= $dir;
|
||||
else
|
||||
$bg= '';
|
||||
$flag= false;
|
||||
$allowed= false;
|
||||
|
||||
if(file_exists($bg.$cF) && $xml= @simplexml_load_file($bg.$cF))
|
||||
{
|
||||
if(($xml->pwd['value']== $p && $xml->login['value']== $l) || ((isset($_SESSION["user"]))? $_SESSION["user"]["login"]=="admin" : false))
|
||||
{
|
||||
$xmlInfo= @simplexml_load_file($bg.$_MIND['userDir'].'/'.$l.'/info.xml');
|
||||
$this->login((string)$xml->login['value']);
|
||||
$this->code($this->login());
|
||||
$this->pwd((string)$xml->pwd['value']);
|
||||
$this->name(utf8_decode((string)$xmlInfo->name['value']));
|
||||
$this->status((string)$xml->status['value']);
|
||||
$this->email(utf8_decode((string)$xml->email['value']));
|
||||
$this->age((string)$xmlInfo->age['value']);
|
||||
$this->description(utf8_decode((string)$xmlInfo->description['value']));
|
||||
$this->position(utf8_decode((string)$xmlInfo->position['value']));
|
||||
$flag= true;
|
||||
$allowed= true;
|
||||
}else{
|
||||
if(!$p)
|
||||
{
|
||||
$xmlInfo= @simplexml_load_file($bg.$_MIND['userDir'].'/'.$l.'/info.xml');
|
||||
$this->login((string)$xml->login['value']);
|
||||
$this->code($this->login());
|
||||
$this->pwd('');
|
||||
$this->name(utf8_decode((string)$xmlInfo->name['value']));
|
||||
$this->status((string)$xml->status['value']);
|
||||
$this->email(utf8_decode((string)$xml->email['value']));
|
||||
$this->age((string)$xmlInfo->age['value']);
|
||||
$this->description(utf8_decode((string)$xmlInfo->description['value']));
|
||||
$this->position(utf8_decode((string)$xmlInfo->position['value']));
|
||||
}else
|
||||
$allowed= false;
|
||||
}
|
||||
}else{
|
||||
$_MIND['fw']->outputPane('Error when trying to load the user information', true);
|
||||
}
|
||||
if(!$allowed)
|
||||
{
|
||||
$_MIND['fw']->outputPane('Invalid current password', true);
|
||||
return false;
|
||||
}
|
||||
return ($flag)? $this: false;
|
||||
}
|
||||
static function userExists($u)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
return file_exists($_MIND['rootDir'].$_MIND['userDir'].'/'.$u);
|
||||
}
|
||||
static function getUsers($login= false)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
|
||||
$dir= $_MIND['rootDir'].$_MIND['userDir'];
|
||||
|
||||
$d = dir($dir);
|
||||
$users= Array();
|
||||
$c=0;
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0,1) !='.')
|
||||
{
|
||||
if(!$login || (is_array($login)? in_array($entry, $login): $login == $entry))
|
||||
{
|
||||
$users[$c]= new User();
|
||||
$xmlInfo= @simplexml_load_file($dir.'/'.$entry.'/info.xml');
|
||||
$xml= @simplexml_load_file($dir.'/'.$entry.'/'.$_MIND['userConfFile'].'.xml');
|
||||
$users[$c]->login((string)$xml->login['value']);
|
||||
$users[$c]->code($users[$c]->login());
|
||||
if($login)
|
||||
$users[$c]->pwd('');
|
||||
else
|
||||
$users[$c]->pwd((string)$xml->pwd['value']);
|
||||
$users[$c]->name(utf8_decode((string)$xmlInfo->name['value']));
|
||||
$users[$c]->status((string)$xml->status['value']);
|
||||
$users[$c]->email(utf8_decode((string)$xml->email['value']));
|
||||
$users[$c]->age((string)$xmlInfo->age['value']);
|
||||
$users[$c]->description(utf8_decode((string)$xmlInfo->description['value']));
|
||||
$users[$c]->position(utf8_decode((string)$xmlInfo->position['value']));
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
return $users;
|
||||
}
|
||||
function populate($ar)
|
||||
{
|
||||
$this->code(isset($ar['login']) ? $ar['login'] : "");
|
||||
$this->name(isset($ar['name']) ? $ar['name'] : "");
|
||||
$this->login(isset($ar['login']) ? $ar['login'] : "");
|
||||
$this->age(isset($ar['age']) ? $ar['age'] : "");
|
||||
$this->pwd(isset($ar['pwd']) ? $ar['pwd'] : "");
|
||||
$this->status(isset($ar['status']) ? $ar['status'] : "");
|
||||
$this->email(isset($ar['email']) ? $ar['email'] : "");
|
||||
$this->description(isset($ar['description']) ? $ar['description'] : "");
|
||||
$this->position(isset($ar['position']) ? $ar['position'] : "");
|
||||
}
|
||||
function save($objUser=false)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$dir= $_MIND['rootDir'];
|
||||
$objUser= ($objUser)? $objUser: $this;
|
||||
$dir= $dir.$_MIND['userDir'].'/'.$objUser->login();
|
||||
if(trim($this->name)!= ''
|
||||
&& trim($this->login)!= ''
|
||||
&& trim($this->pwd)!= ''
|
||||
&& trim($this->email)!= ''
|
||||
&& (trim($this->status)== '0' || trim($this->status)== '1'))
|
||||
{
|
||||
if(!file_exists($dir.'/'.$_MIND['userConfFile'].'.xml'))
|
||||
{
|
||||
if(!@mkdir($dir))
|
||||
return false;
|
||||
mkdir($dir.'/temp');
|
||||
}
|
||||
$confF= $dir.'/'.$_MIND['userConfFile'].'.xml';
|
||||
$infoF= $dir.'/'.'info.xml';
|
||||
$conf= $_MIND['fw']->mkXML($confF);
|
||||
$info= $_MIND['fw']->mkXML($infoF);
|
||||
|
||||
$conf->addChild('login');
|
||||
$conf->login['value']= $this->login();
|
||||
$conf->addChild('pwd');
|
||||
$conf->pwd['value']= $this->pwd();
|
||||
$conf->addChild('status');
|
||||
$conf->status['value']= $this->status();
|
||||
$conf->addChild('email');
|
||||
$conf->email['value']= utf8_encode($this->email());
|
||||
|
||||
$info->addChild('name');
|
||||
$info->name['value']= utf8_encode($this->name());
|
||||
$info->addChild('age');
|
||||
$info->age['value']= $this->age();
|
||||
$info->addChild('description');
|
||||
$info->description['value']= utf8_encode($this->description());
|
||||
$info->addChild('position');
|
||||
$info->position['value']= utf8_encode($this->position());
|
||||
|
||||
$_MIND['fw']->saveXML($conf, $confF);
|
||||
$_MIND['fw']->saveXML($info, $infoF);
|
||||
return true;
|
||||
}else{
|
||||
$_MIND['fw']->outputPane("Invalid or insuficient user data");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function __construct($l=false, $p=false)
|
||||
{
|
||||
if($l)
|
||||
{
|
||||
$this->loadUser($l, $p);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
|
||||
if(!isset($_POST['action']))
|
||||
die('false');
|
||||
$data= JSON_decode($_POST['action']);
|
||||
|
||||
if(!$data)
|
||||
$data= JSON_decode(stripslashes($_POST['action']));
|
||||
|
||||
switch($data->action)
|
||||
{
|
||||
case 'saveDER':
|
||||
{
|
||||
$d= $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$data->project.'/mind/er/';
|
||||
|
||||
if(!file_exists($d))
|
||||
mkdir($d, 0777);
|
||||
$f= fopen($d.$data->name.'.json', 'w+');
|
||||
fclose($f);
|
||||
file_put_contents($d.$data->name.'.json', JSON_encode($data));
|
||||
echo 'true';
|
||||
}break;
|
||||
case 'removeDER':
|
||||
if(unlink($_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$data->project.'/mind/er/'.$data->name.'.json'))
|
||||
echo 'true';
|
||||
else
|
||||
echo JSON_encode($_MIND['fw']->errorOutput(6));
|
||||
break;
|
||||
case '':
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************
|
||||
|
||||
ARQUIVO ATUALIZADO PARA TESTE
|
||||
|
||||
**********************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// hgfhgfhgf hgfhgf hg fhgf
|
||||
?>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
$file= $_MIND['rootDir'].$_MIND['languageDir'].'/'.$_SESSION['current']['lang'].'/'.$_SESSION['current']['lang'].'.xml';
|
||||
if(!$xmlLang= simplexml_load_file($file))
|
||||
{
|
||||
trigger_error(E_USER_ERROR, "Failed trying to access the dictionary!");
|
||||
exit;
|
||||
}
|
||||
if(isset($_POST['newVerb']) && isset($_POST['verbType']))
|
||||
{
|
||||
$parent= null;
|
||||
switch($_POST['verbType'])
|
||||
{
|
||||
case 'm':
|
||||
{
|
||||
$parent= $xmlLang->obligation;
|
||||
break;
|
||||
}
|
||||
case 'px':
|
||||
{
|
||||
$parent= $xmlLang->belongs;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
$parent= $xmlLang->verbs;
|
||||
}
|
||||
}
|
||||
$curVerb= $parent->addChild('verb');
|
||||
$curVerb['value']= strip_tags(addslashes($_POST['newVerb']));
|
||||
file_put_contents($file, $xmlLang->asXML());
|
||||
exit;
|
||||
}
|
||||
if(isset($_POST['newType']) && isset($_POST['type']))
|
||||
{
|
||||
//$child= $xmlLang->types->$_POST['type']->addChild(strip_tags(addslashes($_POST['newType'])));
|
||||
$child= $xmlLang->XPath("types/type[@value='".$_POST['type']."']");
|
||||
if(isset($child[0]))
|
||||
{
|
||||
$substantive= $child[0]->addChild('substantive');
|
||||
$substantive['value']= strip_tags(addslashes($_POST['newType']));
|
||||
file_put_contents($file, $xmlLang->asXML());
|
||||
}
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,338 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
$p= $_GET['p'];
|
||||
|
||||
if(Project::hasProject($p))
|
||||
{
|
||||
if(isset($_GET['projectdirtoshow']))
|
||||
{
|
||||
$original_dir= $_MIND['publishDir'].'/'.$p.'/root/';
|
||||
$userDir= $_MIND['publishDir'].'/'.$p.'/root/';
|
||||
}else{
|
||||
$userDir= $_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$p.'/root/';
|
||||
$original_dir= $userDir;
|
||||
}
|
||||
|
||||
if(isset($_GET['zip']))
|
||||
{
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename="'.$p.'.zip"');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Pragma: no-cache');
|
||||
|
||||
$path= str_replace(basename($_SERVER['SCRIPT_FILENAME']), '', $_SERVER['SCRIPT_FILENAME']);
|
||||
$from= 'cd '.$path.'; cd '.$_MIND['rootDir'].'; cd '.$original_dir.'../;';
|
||||
$ret= exec($from.' zip -r mind/'.$p.'.zip root/');
|
||||
|
||||
readfile($_MIND['rootDir'].$original_dir.'../mind/'.$p.'.zip');
|
||||
exit;
|
||||
}
|
||||
if(isset($_GET['f']))
|
||||
{
|
||||
if(file_exists($_GET['f']))
|
||||
{
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<!-- SyntaxHighlighter -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shCore.js"></script><!-- jQuery -->
|
||||
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushPhp.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushAS3.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushColdFusion.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushBash.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushCpp.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushCSharp.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushCss.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushJava.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushJavaFX.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushJScript.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushPerl.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushPlain.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushPowerShell.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushPython.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushRuby.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushScala.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushSql.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushVb.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="../scripts/SyntaxHighlighter/shBrushXml.js"></script><!-- jQuery -->
|
||||
|
||||
<!-- SyntaxHighlighter -->
|
||||
<link rel="stylesheet" type="text/css" href="../styles/SyntaxHighlighter/shCore.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../styles/SyntaxHighlighter/shThemeRDark.css"/>
|
||||
<style type='text/css'>
|
||||
body, td, li
|
||||
{
|
||||
font-family: Tahoma, Sans-Serif;
|
||||
color:#fff;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
//SyntaxHighlighter.config.clipboardSwf = '/pub/sh/2.1.364/scripts/clipboard.swf';
|
||||
SyntaxHighlighter.defaults['smart-tabs'] = false;
|
||||
SyntaxHighlighter.defaults['wrap-lines'] = false;
|
||||
SyntaxHighlighter.all();
|
||||
function showContent()
|
||||
{
|
||||
parent.document.getElementById('showCodeFrame').style.display= '';
|
||||
parent.document.getElementById('showFileContentLoader').style.display= 'none';
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body leftmargin='0' topmargin='0' bottommargin='0' rightmargin='0'
|
||||
style='margin:0px; padding:0px;background-color:#1B2426;'
|
||||
onload="showContent()">
|
||||
<div style='border-bottom:solid 1px #666;
|
||||
background-color:#e0e0e0;
|
||||
cursor:default;
|
||||
width:100%;
|
||||
color:#000;
|
||||
font-weight:bold;
|
||||
font-size:12px;'>
|
||||
<nobr><?php echo preg_replace('/^.*'.$_GET['p'].'\/root\//', '', $_GET['f']); ?></nobr>
|
||||
</div>
|
||||
<?php
|
||||
$ext= strtolower(preg_replace('/^.*\./', '', $_GET['f']));
|
||||
|
||||
if($ext == 'phtml')
|
||||
$ext= 'html';
|
||||
|
||||
if($ext == 'inc') // I should tell you ... do NOT use .inc files ... even though, if you wan to... ok
|
||||
$ext= 'php';
|
||||
if($ext == 'txt' || $ext == 'json')
|
||||
$ext= 'plain';
|
||||
|
||||
if($ext == 'ini')
|
||||
$ext= 'bash/shell';
|
||||
|
||||
switch($ext)
|
||||
{
|
||||
case 'swf':
|
||||
{
|
||||
?>
|
||||
<table style='width:100%; height:100%; background-color:#ddd; background-repeat:repeat; background-image:url(<?php echo $_MIND['rootDir'].$_MIND['imageDir']; ?>/back_der.gif);'>
|
||||
<tr>
|
||||
<td>
|
||||
<center>
|
||||
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
|
||||
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">
|
||||
<param name="movie"
|
||||
value="<?php echo $_GET['f']; ?>">
|
||||
<param name="quality"
|
||||
value="high">
|
||||
<embed src="<?php echo $_GET['f']; ?>"
|
||||
quality="high"
|
||||
pluginspage="http://www.macromedia.com/go/getflashplayer"
|
||||
type="application/x-shockwave-flash">
|
||||
</embed>
|
||||
</object>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
case 'png':
|
||||
case 'gif':
|
||||
case 'jpg':
|
||||
case 'bmp':
|
||||
{
|
||||
?>
|
||||
<table style='width:100%; height:100%; background-color:#ddd; background-repeat:repeat; background-image:url(<?php echo $_MIND['rootDir'].$_MIND['imageDir']; ?>/back_der.gif);'>
|
||||
<tr>
|
||||
<td>
|
||||
<center>
|
||||
<img src="<?php echo $_GET['f']; ?>"/>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
case 'php':
|
||||
case 'phtml':
|
||||
case 'html':
|
||||
case 'ini':
|
||||
case 'js':
|
||||
case 'java':
|
||||
case 'jfx':
|
||||
case 'javafx':
|
||||
case 'plain':
|
||||
case 'bash/shell':
|
||||
case 'css':
|
||||
case 'xml':
|
||||
case 'xhtml':
|
||||
case 'xslt':
|
||||
case 'cpp':
|
||||
case 'sql':
|
||||
case 'jsp':
|
||||
case 'cpp':
|
||||
case 'c':
|
||||
case 'py':
|
||||
case 'pl':
|
||||
case 'pearl':
|
||||
case 'rails':
|
||||
case 'ror':
|
||||
case 'ruby':
|
||||
case 'vb':
|
||||
case 'vbnet':
|
||||
case 'as3':
|
||||
case 'actionscript3':
|
||||
case 'cs':
|
||||
case 'csharp':
|
||||
case 'aspx':
|
||||
case 'asp':
|
||||
{
|
||||
?>
|
||||
<pre class='brush:<?php echo $ext; ?>;' style='margin:0px; padding:0px;'><?php echo preg_replace('/\t/', ' ', trim(htmlentities(file_get_contents($_GET['f'])))); ?></pre>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
?>
|
||||
<div style='width:100%;
|
||||
height:100%;
|
||||
background-color:#ccc;'>
|
||||
This file cannot be rendered.<br/>
|
||||
But you can still download it and open with a specific software clicking
|
||||
<a href="<?php echo $_GET['f']; ?>" target='_quot'>here</a>.
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
function throughDir($dir)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
GLOBAL $userDir;
|
||||
GLOBAL $projDir;
|
||||
GLOBAL $curVersion;
|
||||
|
||||
$d = dir($dir);
|
||||
$tmpDir;
|
||||
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0, 1) != '.')
|
||||
{
|
||||
$tmpDir= str_replace($userDir, '', $dir.'/'.$entry);
|
||||
$pos= sizeof(explode('/', $tmpDir)) -4;
|
||||
if(is_dir($dir.'/'.$entry))
|
||||
{
|
||||
$id= "files_explorer_".$pos.basename($tmpDir).rand(0,9999);
|
||||
echo "<div onclick=\"$('#".$id."').toggle('slow');\" style='white-space:no-wrap;'><span style='color:#ddd;'>".str_repeat(" | ", $pos)."</span><nobr><img src='".$_MIND['imageDir']."/icon_folder.gif' width='16'/> ".basename($tmpDir).'</nobr></div>';
|
||||
echo "<div style='display:none;' id='".$id."'>";
|
||||
throughDir($dir.'/'.$entry);
|
||||
echo "</div>";
|
||||
}else{
|
||||
echo "<nobr><span style='color:#ddd;'>".str_repeat(" | ", $pos).'</span>';
|
||||
echo "<img src='".$_MIND['imageDir']."/icon_file.gif' width='16'/>";
|
||||
echo '<span style="color:#666;" onclick="showCurrentCodeOf(\''.$dir.'/'.$entry.'\')">'.$entry.'</span></nobr><br/>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
}
|
||||
?>
|
||||
<div style="width:210px;
|
||||
height:99%;
|
||||
overflow:auto;
|
||||
border:solid 1px #333;
|
||||
margin-right:2px;
|
||||
float:left;"
|
||||
id="listFilesDiv">
|
||||
<a href='<?php echo $original_dir; ?>'
|
||||
target='_quot'
|
||||
style='text-decoration:none;padding:0px; margin:0px;'>
|
||||
<div style='border:solid 1px #666;
|
||||
background-color:#e0e0e0;
|
||||
cursor:pointer;
|
||||
height:20px;
|
||||
margin:1px;'
|
||||
onmouseover="this.style.backgroundColor= '#f0f0f0'"
|
||||
onmouseout="this.style.backgroundColor= '#e0e0e0'">
|
||||
See it Running
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo $_SERVER['PHP_SELF'].'?zip=1&p='.$p; ?>'
|
||||
target='downloadFrame'
|
||||
style='text-decoration:none;padding:0px; margin:0px;'>
|
||||
<div style='border:solid 1px #666;
|
||||
background-color:#e0e0e0;
|
||||
cursor:pointer;
|
||||
height:20px;
|
||||
margin:1px;'
|
||||
onmouseover="this.style.backgroundColor= '#f0f0f0'"
|
||||
onmouseout="this.style.backgroundColor= '#e0e0e0'">
|
||||
Download current
|
||||
</div>
|
||||
</a>
|
||||
<a href="JavaScript: $('#addressHereTreeDiv').toggle(); void(0);"
|
||||
style='text-decoration:none;padding:0px; margin:0px;'>
|
||||
<div style='border:solid 1px #666;
|
||||
background-color:#e0e0e0;
|
||||
cursor:pointer;
|
||||
height:20px;
|
||||
margin:1px;'
|
||||
onmouseover="this.style.backgroundColor= '#f0f0f0'"
|
||||
onmouseout="this.style.backgroundColor= '#e0e0e0'">
|
||||
Files Tree
|
||||
</div>
|
||||
</a>
|
||||
<div style='padding:2px;'
|
||||
id='addressHereTreeDiv'>
|
||||
<?php
|
||||
throughDir($_MIND['rootDir'].$userDir);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='showCodePanel'
|
||||
style='overflow:hidden;
|
||||
height:99%;
|
||||
border:solid 1px #333;
|
||||
margin-right:2px;'>
|
||||
<img src="<?php echo $_MIND['imageDir']; ?>/load.gif"
|
||||
style='position:absolute;
|
||||
display:none;'
|
||||
id='showFileContentLoader'>
|
||||
<iframe style='width:100%;height:100%;border:none;'
|
||||
frameborder='0'
|
||||
id='showCodeFrame'
|
||||
src="about:blanc">
|
||||
</iframe>
|
||||
</div>
|
||||
<iframe id='downloadFrame'
|
||||
name='downloadFrame'
|
||||
style='display:none;'>
|
||||
</iframe>
|
||||
<script>
|
||||
|
||||
var showCurrentCodeOf= function(file){
|
||||
//document.getElementById('showCodePanel').innerHTML= "Loading...";
|
||||
document.getElementById('showFileContentLoader').style.display= '';
|
||||
document.getElementById('showCodeFrame').style.display= 'none';
|
||||
document.getElementById('showCodeFrame').src= Mind.Properties.path+'/address_here.php?p='+ Mind.Project.attributes.name+'&f='+file;
|
||||
return;
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#listFilesDiv').resizable({ handles: 'e' });
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
$_SESSION['keepGenerating']= false;
|
||||
?>
|
||||
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
$p= new Project($_SESSION['currentProject'], $_SESSION['user']['login']);
|
||||
|
||||
$curVersion= $_MIND['fw']->currentVersion($p);
|
||||
|
||||
$p->version[1]++;
|
||||
$p->version[2]= 0;
|
||||
$p->date= date('m/d/Y - H:i:s');
|
||||
|
||||
if($p->version[1] <= $curVersion['subVersion'])
|
||||
{
|
||||
header("Location:update.php");
|
||||
exit;
|
||||
}else{
|
||||
$userDir= $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$p->name.'/root';
|
||||
$projDir= $_MIND['rootDir'].$_MIND['publishDir'].'/'.$p->name.'/root';
|
||||
|
||||
|
||||
if(isset($_POST['confirmCommit']))
|
||||
{
|
||||
$p->save();
|
||||
$dirFrom= $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$p->name;
|
||||
$dirTo= $_MIND['rootDir'].$_MIND['publishDir'].'/'.$p->name;
|
||||
|
||||
$dirBackUp= $_MIND['rootDir'].$_MIND['publishDir'].'/'.$p->name.'/'.$_MIND['backupDir'];
|
||||
if(!file_exists($dirBackUp))
|
||||
mkdir($dirBackUp);
|
||||
$dirBackUp.= '/'.date('Ymdhis').'_'.$_SESSION['user']['login'];
|
||||
mkdir($dirBackUp);
|
||||
|
||||
$_MIND['fw']->updateCopy($dirTo.'/root', $dirBackUp);
|
||||
|
||||
$_MIND['fw']->updateCopy($dirFrom, $dirTo);
|
||||
|
||||
$usrs= User::getUsers($p->users); // loads only the users who are working on the current project
|
||||
echo sizeof($usrs).' <<< ';
|
||||
for($i=0, $j= sizeof($usrs); $i<$j; $i++)
|
||||
{
|
||||
//echo $usrs[$i]->email;
|
||||
if(mail($usrs[$i]->email, '[mind2.0] Project commited', "The project ".$p->name." was commited by ".$usrs[$i]->name.".
|
||||
|
||||
--
|
||||
TheWebMind.org 2.0
|
||||
http://thewebmind.org/
|
||||
Documentation: http://docs.thewebmind.org/"));
|
||||
else
|
||||
$_MIND['fw']->log('SMTP Server not found! Mail message culd not be sent.', 'server conf');
|
||||
}
|
||||
|
||||
echo 'The project has been successfully commited to the server';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<table style='width:100%;'>
|
||||
<tr style='font-size:10px;'>
|
||||
<td>
|
||||
<div style='width:10px;
|
||||
height:10px;
|
||||
border:solid 1px #000;
|
||||
background-color:#393;
|
||||
float:left;'>
|
||||
<br/>
|
||||
</div>
|
||||
New Items
|
||||
</td>
|
||||
<td>
|
||||
<div style='width:10px;
|
||||
height:10px;
|
||||
border:solid 1px #000;
|
||||
background-color:#c96;
|
||||
float:left;'>
|
||||
<br/>
|
||||
</div>
|
||||
Items to replace
|
||||
</td>
|
||||
<td>
|
||||
<div style='width:10px;
|
||||
height:10px;
|
||||
border:solid 1px #000;
|
||||
background-color:#f00;
|
||||
float:left;'>
|
||||
<br/>
|
||||
</div>
|
||||
Items to replace that have been changed
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3'>
|
||||
<div style='background-color:#fff;
|
||||
border:solid 1px #666;
|
||||
height:334px;
|
||||
overflow:auto;
|
||||
font-size:10px;
|
||||
padding:4px;'>
|
||||
<?php
|
||||
|
||||
function throughDir($dir)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
GLOBAL $userDir;
|
||||
GLOBAL $projDir;
|
||||
GLOBAL $curVersion;
|
||||
|
||||
$d = dir($dir);
|
||||
$tmpDir;
|
||||
//echo $curVersion['date'].'<hr>';
|
||||
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if($entry != '.' && $entry != '..')
|
||||
{
|
||||
$tmpDir= str_replace($userDir, '', $dir.'/'.$entry);
|
||||
$pos= sizeof(explode('/', $tmpDir)) -2;
|
||||
if(is_dir($dir.'/'.$entry))
|
||||
{
|
||||
echo "<span style='color:#ddd;'>".str_repeat(" | ", $pos)."</span><img src='".$_MIND['imageDir']."/icon_folder.gif' width='16'/> ".$tmpDir.'<br/>';
|
||||
throughDir($dir.'/'.$entry);
|
||||
}else{
|
||||
echo "<span style='color:#ddd;'>".str_repeat(" | ", $pos).'</span>';
|
||||
echo "<img src='".$_MIND['imageDir']."/icon_file.gif' width='16'/>";
|
||||
if(!file_exists($projDir.$tmpDir))
|
||||
echo '<span style="color:#393;">'.$entry.'</span><br/>';
|
||||
else{
|
||||
if(date('YmdHi', filemtime($projDir.$tmpDir)) > date('YmdHi', filemtime($projDir.'/../conf.xml')))
|
||||
echo '<span style="color:#f00;font-weight:bold;">'.$entry.'</span><br/>';
|
||||
else
|
||||
echo '<span style="color:#c96;">'.$entry.'</span><br/>';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
}
|
||||
throughDir($userDir);
|
||||
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<center>
|
||||
<input type='button'
|
||||
value='Commit'
|
||||
class='ui-state-default ui-corner-all'
|
||||
style='height:26px;'
|
||||
onclick="Mind.Project.ConfirmCommit();"/>
|
||||
</center>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,177 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
$r = Array();
|
||||
function getComponent($name,$data=false)
|
||||
{
|
||||
GLOBAL $r;
|
||||
GLOBAL $_MIND;
|
||||
|
||||
switch($name){
|
||||
case "projectList" :
|
||||
$p = new Project();
|
||||
$projectList= $p->getProjects($_SESSION['user']['login']);
|
||||
$r['projectList']= ($projectList)? json_encode($projectList): 'false';
|
||||
break;
|
||||
case "home" :
|
||||
$r['home']= json_encode(str_replace("{MIND['home_page']}", $_MIND['home_page'], file_get_contents('home_page.php')));
|
||||
break;
|
||||
case "right_panel" :
|
||||
$r['right_panel']= json_encode("Painel da direita");
|
||||
break;
|
||||
case "projectData" :
|
||||
$p= new Project($data->name, $_SESSION['user']['login']);
|
||||
$langDir= $_MIND['rootDir'].$_MIND['languageDir'].'/';
|
||||
include($langDir.'language.php');
|
||||
$lang= new Language($p->lang);
|
||||
$p->verb= $lang->verbs[0];
|
||||
$r['projectData']= json_encode($p);
|
||||
break;
|
||||
case "pluginData" :
|
||||
$pl= new Plugin($data->name, $_SESSION['user']['login']);
|
||||
$r['pluginData']= json_encode($pl);
|
||||
break;
|
||||
case "userData" :
|
||||
$u= new User($data->name, $_SESSION['user']['login']);
|
||||
$r['userData']= json_encode($u);
|
||||
break;
|
||||
case "mindApplicationList" :
|
||||
$r['mindApplicationList']= json_encode("");
|
||||
break;
|
||||
case "project" :
|
||||
$_POST['pName']= $data->name;
|
||||
$_SESSION['currentProject']= $_POST['pName'];
|
||||
$r['project']= json_encode($_MIND['fw']->import($_MIND['rootDir'].$_MIND['components'].'/project.php'));
|
||||
break;
|
||||
case "DBMSsList":
|
||||
GLOBAL $_MIND;
|
||||
$l= $_MIND['fw']->getDBMSs();
|
||||
$r['DBMSsList']= json_encode($l);
|
||||
break;
|
||||
case "languagesList":
|
||||
GLOBAL $_MIND;
|
||||
$l= $_MIND['fw']->getLanguages();
|
||||
$r['languagesList']= json_encode($l);
|
||||
break;
|
||||
case "usersList":
|
||||
GLOBAL $_MIND;
|
||||
$l= $_MIND['fw']->getUsers();
|
||||
$r['usersList']= json_encode($l);
|
||||
break;
|
||||
case "savedDERList":
|
||||
GLOBAL $_MIND;
|
||||
$l= $_MIND['fw']->getSavedERDList($data->project);
|
||||
$r['savedDERList']= json_encode($l);
|
||||
break;
|
||||
case "savedDERItem":
|
||||
GLOBAL $_MIND;
|
||||
$l= $_MIND['fw']->getSavedERDItem($data->project, $data->diagram);
|
||||
$r['savedDERItem']= $l; // it is already a json encoded value
|
||||
break;
|
||||
case "moduleList":
|
||||
GLOBAL $_MIND;
|
||||
$l= $_MIND['fw']->getModulesList();
|
||||
$r['moduleList']= json_encode($l);
|
||||
break;
|
||||
case "getModule":
|
||||
GLOBAL $_MIND;
|
||||
$l= $_MIND['fw']->getModule($data->moduleName);
|
||||
$r['getModule']= json_encode($l);
|
||||
break;
|
||||
case "plugins":
|
||||
GLOBAL $_MIND;
|
||||
$l= $_MIND['fw']->getPlugins();
|
||||
$r['plugins']= json_encode($l);
|
||||
break;
|
||||
case "pluginsUnlinkThis":
|
||||
GLOBAL $_MIND;
|
||||
$d= $_MIND['rootDir'].$_MIND['pluginDir'].'/'.$data->pName.'/data/'.$data->file;
|
||||
if(@unlink($d))
|
||||
$l= true;
|
||||
else
|
||||
$l= false;
|
||||
$r['pluginsUnlinkThis']= json_encode($l);
|
||||
break;
|
||||
case "pluginsSave":
|
||||
GLOBAL $_MIND;
|
||||
if(isset($data->flag))
|
||||
$flag= FILE_APPEND;
|
||||
else
|
||||
$flag= null;
|
||||
$d= $_MIND['rootDir'].$_MIND['pluginDir'].'/'.$data->pName.'/data/'.$data->file;
|
||||
if(!file_exists($d))
|
||||
{
|
||||
$f= fopen($d, 'w+');
|
||||
fclose($f);
|
||||
}
|
||||
|
||||
$l= (@file_put_contents($d, $data->content, $flag))? true: false;
|
||||
|
||||
$r['pluginsSave']= json_encode($l);
|
||||
break;
|
||||
case "pluginsLoadFile":
|
||||
GLOBAL $_MIND;
|
||||
$d= $_MIND['rootDir'].$_MIND['pluginDir'].'/'.$data->pName.'/data/'.$data->file;
|
||||
if(!file_exists($d))
|
||||
$l= false;
|
||||
else{
|
||||
$l= Array();
|
||||
$l['name']= $data->file;
|
||||
$l['address']= $_MIND['pluginDir'].'/'.$data->pName.'/data/'.$data->file;
|
||||
$l['size']= filesize($d);
|
||||
$l['content']= file_get_contents($d);
|
||||
$l['lastChange']= filectime($d);
|
||||
}
|
||||
$r['pluginsLoadFile']= json_encode($l);
|
||||
break;
|
||||
case "pluginsMkDir":
|
||||
GLOBAL $_MIND;
|
||||
$d= $_MIND['rootDir'].$_MIND['pluginDir'].'/'.$data->pName.'/data/'.$data->dir;
|
||||
if(!file_exists($d))
|
||||
@mkdir($d);
|
||||
if(file_exists($d))
|
||||
$l= true;
|
||||
else
|
||||
$l= false;
|
||||
$r['pluginsMkDir']= json_encode($l);
|
||||
break;
|
||||
case "pluginList":
|
||||
GLOBAL $_MIND;
|
||||
$dAdd= $_MIND['rootDir'].$_MIND['pluginDir'].'/'.$data->pName.'/data/'.$data->dir;
|
||||
if(!file_exists($dAdd))
|
||||
return $r['pluginList']= json_encode(false);
|
||||
$d = dir($dAdd);
|
||||
$l= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
$type= (is_dir($dAdd.'/'.$entry))? 'directory':'file';
|
||||
if(substr($entry, 0,1) != '.')
|
||||
$l[]= Array('name'=>$entry, 'type'=>$type, 'address'=>$_MIND['pluginDir'].'/'.$data->pName.'/data/'.$data->dir.'/'.$entry);
|
||||
}
|
||||
$d->close();
|
||||
|
||||
if(sizeof($l) == 0)
|
||||
$l= false;
|
||||
|
||||
$r['pluginList']= json_encode($l);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$objJSON = json_decode(stripslashes($_POST['component']));
|
||||
|
||||
for($i=0;$i<sizeof($objJSON);$i++)
|
||||
{
|
||||
if(is_string($objJSON[$i]))
|
||||
{
|
||||
getComponent($objJSON[$i]);
|
||||
}else{
|
||||
if(@isset($objJSON[$i]->data))
|
||||
getComponent($objJSON[$i]->componentName, $objJSON[$i]->data);
|
||||
else
|
||||
getComponent($objJSON[$i]->componentName);
|
||||
}
|
||||
}
|
||||
echo json_encode($r);
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<div style='display:none;'>
|
||||
<table id='debugerEstructure' style='width:100%;height:100%;'>
|
||||
<tr>
|
||||
<td style='width:20px;'>
|
||||
</td>
|
||||
<td>
|
||||
<div style='width:100%;
|
||||
height: 100%;'
|
||||
id='debugerEstructureTree'>
|
||||
<br>
|
||||
</div>
|
||||
<div style='width:100%;
|
||||
height: 100%;'
|
||||
id='debugerEstructureCodes'>
|
||||
<center>
|
||||
<textarea style='width:49%;height:100%;'></textarea>
|
||||
<textarea style='width:49%;height:100%;'></textarea>
|
||||
</center>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if(Project::hasProject($_GET['pName']))
|
||||
{
|
||||
$pName= $_GET['pName'];
|
||||
$p= new Project($pName, $_SESSION['user']['login']);
|
||||
//$p->process();
|
||||
if(isset($_GET['onlyDDL']))
|
||||
$p->export($_GET['onlyDDL']);
|
||||
else
|
||||
$p->export();
|
||||
}else{
|
||||
echo "top.Mind.Dialog.ShowError(".JSON_encode($_MIND['fw']->errorOutput(2)).")";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?>
|
||||
<iframe src="http://spreadsheets.google.com/embeddedform?key=tXlJv4mhIeTyAXds7qRH7-A" width="570" height="1012" scrolling="no" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php ?>
|
||||
find here, new plugins to download and "instal"
|
||||
@@ -0,0 +1,434 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
|
||||
if(isset($_GET['projectName']) && isset($_SESSION['user']['login'])){
|
||||
$p= new Project($_GET['projectName'], $_SESSION['user']['login']);
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function enableNext()
|
||||
{
|
||||
$("#generateModalForm").wizard("enableNext");
|
||||
}
|
||||
function disableNext()
|
||||
{
|
||||
$("#generateModalForm").wizard("disableNext");
|
||||
}
|
||||
jQuery(function($){
|
||||
var a = $("#generateModalForm").wizard({
|
||||
animated: "slideDown",
|
||||
historyEnabled: false,
|
||||
formPluginEnabled: false,
|
||||
validationEnabled: false,
|
||||
show: function(evnt, args)
|
||||
{
|
||||
switch(args.stepInx)
|
||||
{
|
||||
case 0:
|
||||
Mind.Project.tmp= Array();
|
||||
$("#generateModalForm").wizard("enableNext");
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(document.getElementById('generate_only_database').checked)
|
||||
{
|
||||
document.getElementById('noModule').style.display= '';
|
||||
document.getElementById('moduleStep').style.display= 'none';
|
||||
enableNext();
|
||||
return;
|
||||
}else{
|
||||
document.getElementById('noModule').style.display= 'none';
|
||||
document.getElementById('moduleStep').style.display= '';
|
||||
if(Mind.Project.tmp['selectedModule'])
|
||||
enableNext();
|
||||
}
|
||||
if(!Mind.Project.tmp['selectedModule'])
|
||||
$("#generateModalForm").wizard("disableNext");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
disableNext();
|
||||
document.getElementById('thirdStepGenerating').innerHTML= "Loading...";
|
||||
var x= null;
|
||||
|
||||
var sec= 0;
|
||||
if(Mind.Project.tmp['dependences']) // it's not ONLY datasbase
|
||||
{
|
||||
for(x in Mind.Project.tmp['dependences']['styles'])
|
||||
{
|
||||
$("<link>").attr({"rel":"stylesheet",
|
||||
"type":"text/css",
|
||||
"href":Mind.Project.tmp['dependences']['styles'][x].toLowerCase(),
|
||||
"media":"screen"
|
||||
}).appendTo(document.getElementsByTagName("head")[0]);
|
||||
sec+= 500;
|
||||
}
|
||||
for(x in Mind.Project.tmp['dependences']['scripts'])
|
||||
{
|
||||
$.getScript(Mind.Project.tmp['dependences']['scripts'][x].toLowerCase(),function(){});
|
||||
sec+= 500;
|
||||
}
|
||||
setTimeout(function(){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Mind.Properties.path+'/module_options.php'.toLowerCase(),
|
||||
data: {'module': Mind.Project.tmp['selectedModule'], 'noDataBase': document.getElementById('database_pref_noDataBase').checked},
|
||||
success: function(ret){
|
||||
document.getElementById('thirdStepGenerating').innerHTML= ret;
|
||||
$("#generateModalForm").wizard("enableNext");
|
||||
},
|
||||
error : function(XMLHttpRequest,textStatus,errorThrown){
|
||||
Mind.AjaxHandler.Capture(XMLHttpRequest);
|
||||
enableNext();
|
||||
}
|
||||
});
|
||||
}, sec);
|
||||
}else{
|
||||
setTimeout(function(){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Mind.Properties.path+'/module_options.php'.toLowerCase(),
|
||||
data: {onlyDataBase: 'true'},
|
||||
success: function(ret){
|
||||
document.getElementById('thirdStepGenerating').innerHTML= ret;
|
||||
$("#generateModalForm").wizard("enableNext");
|
||||
},
|
||||
error : function(XMLHttpRequest,textStatus,errorThrown){
|
||||
Mind.AjaxHandler.Capture(XMLHttpRequest);
|
||||
enableNext();
|
||||
}
|
||||
});
|
||||
}, sec);
|
||||
//document.getElementById('thirdStepGenerating').innerHTML= "There are no advanced options";
|
||||
enableNext();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$("#generateModalForm").wizard("disableNext");
|
||||
}
|
||||
|
||||
if(args.stepInx == 0)
|
||||
{
|
||||
$("#generateModalForm").wizard("enableNext");
|
||||
}
|
||||
},
|
||||
onSubmit : function(){
|
||||
Mind.Project.tmp= false;
|
||||
Mind.Project.tmp= Array();
|
||||
|
||||
$('#generatingLoadBar').progressbar({
|
||||
value:0,
|
||||
change:function(event, ui){
|
||||
document.getElementById('generatingLoadBarPerc').innerHTML= $('#generatingLoadBar').progressbar('option', 'value')+'%';
|
||||
}
|
||||
});
|
||||
var v= Mind.Project.attributes['version'][0];
|
||||
if(document.getElementById('database_pref_noDataBase').checked)
|
||||
{
|
||||
v+= '.'+ Mind.Project.attributes['version'][1];
|
||||
v+= '.'+ (parseInt(Mind.Project.attributes['version'][2]) + 1);
|
||||
}else{
|
||||
v+= '.'+ (parseInt(Mind.Project.attributes['version'][1])+ 1);
|
||||
v+= '.0';
|
||||
}
|
||||
document.getElementById('generatingProjectName').innerHTML= Mind.Project.attributes['name'];
|
||||
document.getElementById('generatingProjectVs').innerHTML= v;
|
||||
document.getElementById('hiddenProjectAttributes').value= JSON.stringify(Mind.Project.attributes);
|
||||
document.getElementById('generateModalForm').action= Mind.Properties.path+'/generating.php';
|
||||
document.getElementById('generateModalForm').submit();
|
||||
document.getElementById('generateModalForm').style.display= 'none';
|
||||
document.getElementById('generatingWithModule').style.display= '';
|
||||
}
|
||||
});
|
||||
|
||||
$("#fieldsetDev").bind("click",function(){
|
||||
$("#database_pref_development").trigger("click");
|
||||
});
|
||||
$("#fieldsetDev").bind("mouseover",function(){
|
||||
//$(this).css("border","solid 2px #c99300");
|
||||
$(this).css("background","#f0f0f0");
|
||||
});
|
||||
$("#fieldsetDev").bind("mouseout",function(){
|
||||
//$(this).css("border","");
|
||||
$(this).css("background","transparent");
|
||||
});
|
||||
|
||||
$("#fieldsetProd").bind("click",function(){
|
||||
$("#database_pref_production").trigger("click");
|
||||
});
|
||||
$("#fieldsetProd").bind("mouseover",function(){
|
||||
//$(this).css("border","solid 2px #c99300");
|
||||
$(this).css("background","#f0f0f0");
|
||||
});
|
||||
$("#fieldsetProd").bind("mouseout",function(){
|
||||
//$(this).css("border","");
|
||||
$(this).css("background","transparent");
|
||||
});
|
||||
|
||||
$("#fieldsetOnlyDataBase").bind("click",function(){
|
||||
$("#generate_only_database").trigger("click");
|
||||
});
|
||||
$("#fieldsetOnlyDataBase").bind("mouseover",function(){
|
||||
//$(this).css("border","solid 2px #c99300");
|
||||
$(this).css("background","#f0f0f0");
|
||||
});
|
||||
$("#fieldsetOnlyDataBase").bind("mouseout",function(){
|
||||
//$(this).css("border","");
|
||||
$(this).css("background","transparent");
|
||||
});
|
||||
|
||||
$("#fieldsetNoDataBase").bind("click",function(){
|
||||
$("#database_pref_noDataBase").trigger("click");
|
||||
});
|
||||
$("#fieldsetNoDataBase").bind("mouseover",function(){
|
||||
//$(this).css("border","solid 2px #c99300");
|
||||
$(this).css("background","#f0f0f0");
|
||||
});
|
||||
$("#fieldsetNoDataBase").bind("mouseout",function(){
|
||||
//$(this).css("border","");
|
||||
$(this).css("background","transparent");
|
||||
});
|
||||
<?php
|
||||
$p= new Project($_SESSION['currentProject'], $_SESSION['user']['login']);
|
||||
echo ' Mind.Project.attributes["version"][0]= '.$p->version[0].'; ';
|
||||
echo ' Mind.Project.attributes["version"][1]= '.$p->version[1].'; ';
|
||||
echo ' Mind.Project.attributes["version"][2]= '.$p->version[2].'; ';
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
<div class="project_generate_wizardParent" id='project_generate_wizardParent'>
|
||||
<div class="project_generate_wizard">
|
||||
<!--<img src="images/wizard.png" style="position:absolute;bottom:-5px;right:-6px;z-index:0">-->
|
||||
<form id="generateModalForm" name='generateModalForm' target='generatingAllStatus' method='POST'>
|
||||
<div class="step" style="padding:10px; height:400px;">
|
||||
<span style="font-weight:bold;font-size:15px">Step <span style="font-size:24px">1</span> - Choose your database preferences</span>
|
||||
<table style='width:100%;'>
|
||||
<tr>
|
||||
<td>
|
||||
<input style="width:16px;height:16px;" id="database_pref_noDataBase" type="radio" name="database_pref" checked='checked' value="no" />
|
||||
</td>
|
||||
<td>
|
||||
<fieldset id="fieldsetNoDataBase">
|
||||
<legend><b>Do NOT Generate Data Base:</b></legend>
|
||||
Your Database wont suffer any change.
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input style="width:16px;height:16px;" id="database_pref_development" name="database_pref" type="radio" value="development" />
|
||||
<textarea style='display:none;' name='p' id='hiddenProjectAttributes' ></textarea>
|
||||
</td>
|
||||
<td>
|
||||
<fieldset id="fieldsetDev">
|
||||
<legend><b>Development Database:<b></legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Address:
|
||||
</td>
|
||||
<td>
|
||||
<i><?php echo $p->environment["development"]["dbAddress"];?> : <?php echo $p->environment["development"]["dbPort"];?></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Name:
|
||||
</td>
|
||||
<td>
|
||||
<i><?php echo $p->environment["development"]["dbName"];?></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Root User:
|
||||
<i><?php echo $p->environment["development"]["rootUser"];?></i>
|
||||
</td>
|
||||
<td style='padding-left:15px;'>
|
||||
User:
|
||||
<i><?php echo $p->environment["development"]["user"];?></i>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input style="width:16px;height:16px;" id="database_pref_production" type="radio" name="database_pref" value="production" />
|
||||
</td>
|
||||
<td>
|
||||
<fieldset id="fieldsetProd">
|
||||
<legend><b>Production Database:</b></legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Address:
|
||||
</td>
|
||||
<td>
|
||||
<i><?php echo $p->environment["production"]["dbAddress"];?> : <?php echo $p->environment["production"]["dbPort"];?></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Name:
|
||||
</td>
|
||||
<td>
|
||||
<i><?php echo $p->environment["production"]["dbName"];?></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Root User:
|
||||
<i><?php echo $p->environment["production"]["rootUser"];?></i>
|
||||
</td>
|
||||
<td style='padding-left:15px;'>
|
||||
User:
|
||||
<i><?php echo $p->environment["production"]["user"];?></i>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input style="width:16px;height:16px;" id="generate_only_database" type="radio" name="database_pref" value="only_database" />
|
||||
</td>
|
||||
<td>
|
||||
<fieldset id="fieldsetOnlyDataBase">
|
||||
<legend><b>Generate only Database:</b></legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<select name='only_database'>
|
||||
<option id='onlyDB_development' value='development'>Development</option>
|
||||
<option id='onlyDB_production' value='production'>Production</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="step" style="padding:10px" id="step2">
|
||||
<div style="height:400px;overflow:auto;">
|
||||
<div id='noModule'
|
||||
style='display:none;'>
|
||||
<span style="font-weight:bold;font-size:15px">Step <span style="font-size:24px">2</span> - Choose your Module preferences</span>
|
||||
<br/><br/>
|
||||
No Module will be needed.
|
||||
</div>
|
||||
<div id='moduleStep'>
|
||||
<span style="font-weight:bold;font-size:15px">Step <span style="font-size:24px">2</span> - Choose your Module preferences</span>
|
||||
<table cellspacing='0' cellpadding='0'>
|
||||
<tr>
|
||||
<td style="border:solid 1px; vertical-align:top;" id="mind_module_list">
|
||||
<table cellpadding='2' cellspacing='0'>
|
||||
<?php
|
||||
$l= $_MIND['fw']->getModulesList();
|
||||
for($i=0;$i<sizeof($l);$i++)
|
||||
{
|
||||
if(is_dir($_MIND['rootDir'].$_MIND['moduleDir'].'/'.$l[$i]))
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td class='wizardModuleItem'
|
||||
onmouseover="this.className= 'wizardModuleItem_over';"
|
||||
onmouseout="this.className= 'wizardModuleItem';"
|
||||
onclick="disableNext(); Mind.Project.GetModule('<?php echo $l[$i]; ?>', this);">
|
||||
<input type='radio' name='module' style='display:non;' value="<?php echo $l[$i]; ?>">
|
||||
<?php echo $l[$i]; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
<td style="vertical-align:top;padding:8px;border:solid 1px;width:100%" id="mind_module_content">
|
||||
<br/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="step3" class="step" style='padding:10px; height:400px;overflow:auto;'>
|
||||
<span style="font-weight:bold;font-size:15px">Step <span style="font-size:24px">3</span> - Choose your advanced preferences</span>
|
||||
<div id='thirdStepGenerating'>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<button value="Reset" style="background-repeat:no-repeat;background-position:left;background-image:url(images/arrow_left.png);width:80px;height:27px;font-size:12px" class="ui-corner-all wizard_back">Reset</button>
|
||||
<button value="Submit" class="ui-corner-all wizard_next" style="background-repeat:no-repeat;background-position:right;background-image:url(images/arrow_right.png);width:80px;height:27px;font-size:12px" >next</button>
|
||||
</form>
|
||||
<div style='height:360px; display:none;' id='generatingWithModule'>
|
||||
<fieldset style='border-bottom:none;'>
|
||||
<legend>
|
||||
<b>
|
||||
Generating
|
||||
</b>
|
||||
</legend>
|
||||
<br/>
|
||||
<div>
|
||||
Generating project <b><span id='generatingProjectName'>NAME</span> <span id='generatingProjectVs'>0.0.0</span></b><br/>
|
||||
in <b><span id='generatingProjectDir'>user's directory</span></b><br/><br/>
|
||||
Generated by <b><?php echo $_SESSION['user']['name']; ?></b> at <b><?php echo date('d\t\h F/Y - H:i a '); ?></b>
|
||||
</div>
|
||||
<br/>
|
||||
<div style='text-align:center;padding:4px;'>
|
||||
<!--<div style='background-image:url(<?php echo $_MIND['imageDir'].'/gen_loader.gif'?>);width:120px;height:12px;'>
|
||||
</div>-->
|
||||
<center>
|
||||
<div id='generatingLoadBar' style='margin:4px;width:420px;height:16px;'>
|
||||
<span id='generatingLoadBarPerc'
|
||||
style='position:absolute;right:115px;'>
|
||||
</span>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
<center>
|
||||
<br/>
|
||||
<div style='height:200px;'>
|
||||
<div style='border:solid 1px #666;width:460px; overflow:hidden;padding3px;white-space:nowrap;text-align:left;padding:2px;height:15px;'>
|
||||
Currently:
|
||||
<span id='generatingCurrentStatus' style='padding-left:14px;'>
|
||||
<br/>
|
||||
</span>
|
||||
</div>
|
||||
<div style='text-align:right'>
|
||||
<sup style='cursor:pointer;font-size:9px;'onclick="$('#generatingAllStatus').toggle();">Show/Hide Details</sup>
|
||||
</div>
|
||||
<iframe name='generatingAllStatus' id='generatingAllStatus'
|
||||
style='border:inset 1px #666;
|
||||
height:140px;
|
||||
width:460px;
|
||||
overflow:auto;
|
||||
display:non;
|
||||
padding:2px;
|
||||
background-color:#fff;
|
||||
text-align:left;
|
||||
margin-top:4px;'></iframe>
|
||||
</div>
|
||||
</center>
|
||||
<div style='text-align:right;'>
|
||||
<input class='ui-state-default ui-corner-all'
|
||||
style='width:50px;height:22px;text-align:center;cursor:default;'
|
||||
value='Abort'
|
||||
onclick="Mind.Project.AbortProcessing();"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if($_POST)
|
||||
{
|
||||
set_time_limit(72000); // 20 Minutes
|
||||
|
||||
if($_POST['database_pref'] != 'only_database')
|
||||
{
|
||||
$numberOfSteps= 7; // extra steps Mind uses to itself
|
||||
}else{
|
||||
$numberOfSteps= 3; // extra steps Mind uses to itself
|
||||
}
|
||||
|
||||
$_SESSION['keepGenerating']= true;
|
||||
?>
|
||||
<style type='text/css'>
|
||||
div
|
||||
{
|
||||
font-weight:normal;
|
||||
border-bottom:dashed 1px #eee;
|
||||
margin:2px;
|
||||
}
|
||||
#here
|
||||
{
|
||||
border-bottom:none;
|
||||
}
|
||||
</style>
|
||||
<body topmargin='1' leftmargin='1' style='font-family:Tahoma; background-color:#fff;color:#666;font-size:12px;'>
|
||||
<div id='here'><!-- -->
|
||||
</div>
|
||||
</body>
|
||||
<?php
|
||||
$errMsg= "<span style='color:red;font-weight:bold'>ERROR: </span>An error ocurred while trying to generate the project.";
|
||||
|
||||
function showLoadStatus($s, $c= false)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
if($_SESSION['keepGenerating'] !== true)
|
||||
{
|
||||
exit;
|
||||
}
|
||||
?><script><?php
|
||||
if($c)
|
||||
{
|
||||
if($c>100)
|
||||
$c= 100;
|
||||
if($c<$_SESSION['currentPerc'])
|
||||
{
|
||||
$_SESSION['currentPerc']= $c;
|
||||
echo " parent.\$('#generatingLoadBar').progressbar('value', ".$c."); ";
|
||||
}
|
||||
}else{
|
||||
$_SESSION['currentPerc']+= $_SESSION['perc'];
|
||||
echo " parent.\$('#generatingLoadBar').progressbar('value', ".$_SESSION['currentPerc']."); ";
|
||||
}
|
||||
?>document.getElementById('here').innerHTML+="<div><?php echo $s; ?></div>";parent.document.getElementById('generatingCurrentStatus').innerHTML="<?php echo $s; ?>";window.scrollBy(0,20);</script><?php
|
||||
$_MIND['fw']->forceFlush();
|
||||
}
|
||||
|
||||
$_SESSION['currentPerc']= 0;
|
||||
|
||||
$_SESSION['perc']= 0;
|
||||
showLoadStatus("Preparing to generate");
|
||||
$data= JSON_decode($_POST['p']);
|
||||
if(!$data)
|
||||
$data= JSON_decode(stripslashes($_POST['p']));
|
||||
|
||||
$data= $_MIND['fw']->objectToArray($data);
|
||||
|
||||
$p= new Project($data['name'], $_SESSION['user']['login']);
|
||||
$p->populate($data);
|
||||
|
||||
$p->version[2]++;
|
||||
$p->save();
|
||||
|
||||
if($p->process())
|
||||
{
|
||||
if($_POST['database_pref']!='only_database'){
|
||||
showLoadStatus("Negotiating with module", 4);
|
||||
$numberOfSteps+= sizeof($p->knowledge->tables);
|
||||
}
|
||||
}else{
|
||||
showLoadStatus($errMsg);
|
||||
exit;
|
||||
}
|
||||
|
||||
/* echo '<pre>';
|
||||
print_r($p->knowledge);
|
||||
echo '</pre>';
|
||||
exit;*/
|
||||
if($_POST['database_pref'] != 'no' && $_POST['database_pref'] != 'only_database'){
|
||||
$numberOfSteps+= sizeOf($p->knowledge->tables) + 2;
|
||||
}
|
||||
$numberOfSteps++;
|
||||
|
||||
$_SESSION['perc']= number_format((96 / $numberOfSteps), 2, '.', '');
|
||||
|
||||
|
||||
if($_POST['database_pref'] != 'only_database')
|
||||
{
|
||||
$m= new Module($_POST['module']);
|
||||
unset($p->knowledge->especialChars);
|
||||
unset($p->knowledge->fixedChars);
|
||||
unset($p->knowledge->relations);
|
||||
unset($p->knowledge->tmpSentences);
|
||||
unset($p->knowledge->processedWML);
|
||||
unset($p->knowledge->unique);
|
||||
unset($p->knowledge->required);
|
||||
unset($p->knowledge->verbId);
|
||||
unset($p->knowledge->quantifierId);
|
||||
unset($p->knowledge->quantifiers);
|
||||
$m->loadModule($p);
|
||||
}
|
||||
// preparing bkps and directories structure
|
||||
|
||||
|
||||
if($_POST['database_pref'] != 'only_database')
|
||||
{
|
||||
showLoadStatus("Creating a backup");
|
||||
|
||||
$pDir = $_MIND['rootDir'] . $_MIND['userDir'] . '/' . $_SESSION['user']['login'] . '/temp/' . $p->name . '/root/';
|
||||
$pDirForFW = $_MIND['userDir'] . '/' . $_SESSION['user']['login'] . '/temp/' . $p->name.'/root/';
|
||||
$mDir = $_MIND['rootDir'] . $_MIND['moduleDir'] . '/' . $m->name . '/data/';
|
||||
$mDirForFW = $_MIND['moduleDir']. '/' . $m->name . '/data/';
|
||||
$tmpDir = $_MIND['rootDir'] . $_MIND['userDir'] . '/' . $_SESSION['user']['login'] . '/temp/' . $p->name . '/tmp_root';
|
||||
|
||||
showLoadStatus("Creating directories structure");
|
||||
if(file_exists($tmpDir))
|
||||
$_MIND['fw']->deleteDirectory($tmpDir);
|
||||
rename($pDir, $tmpDir);
|
||||
chmod($tmpDir, 0777);
|
||||
mkdir($pDir, 0777);
|
||||
|
||||
showLoadStatus("Copying files");
|
||||
$m->structure($mDirForFW, $pDirForFW);
|
||||
$m->pDir($pDir);
|
||||
$m->mDir($mDir);
|
||||
|
||||
showLoadStatus("Calling module");
|
||||
$m->onStart();
|
||||
showLoadStatus("Copies done");
|
||||
|
||||
$t= $p->knowledge->tables;
|
||||
reset($t);
|
||||
showLoadStatus("Starting CRUD");
|
||||
while($tb= current($t))
|
||||
{
|
||||
showLoadStatus('Building files: '.$tb->name);
|
||||
$m->askForCRUD($tb);
|
||||
next($t);
|
||||
}
|
||||
|
||||
showLoadStatus("Closing module");
|
||||
$m->onFinish();
|
||||
|
||||
showLoadStatus("Cleaning the mess...removing temp files");
|
||||
$_MIND['fw']->deleteDirectory($tmpDir);
|
||||
}
|
||||
|
||||
if($_POST['database_pref'] != 'only_database')
|
||||
{
|
||||
showLoadStatus("Using any extra information");
|
||||
$m->callExtra();
|
||||
}
|
||||
|
||||
/* generating database, if required */
|
||||
if($_POST['database_pref'] != 'no')
|
||||
{
|
||||
$p->generateQueries();
|
||||
|
||||
if($_POST['database_pref'] == 'only_database'){
|
||||
$_POST['database_pref'] = $_POST['only_database'];
|
||||
}
|
||||
if($con= @$p->dbmsObj->connectTo($p->environment[$_POST['database_pref']]))
|
||||
{
|
||||
showLoadStatus("Connecting to ".$_POST['database_pref'] ." database .......");
|
||||
}else{
|
||||
showLoadStatus("<b>ERROR: </b>Failed to connect to DataBase ... aborting (files have already been created)<br/><br/>");
|
||||
exit;
|
||||
}
|
||||
|
||||
$t= $p->knowledge->tables;
|
||||
reset($t);
|
||||
echo '<pre>';
|
||||
while($tb= current($t))
|
||||
{
|
||||
if($p->dbmsObj->tableExists($con, $tb->name))
|
||||
{
|
||||
if($_POST['existingTables']== '1')
|
||||
{
|
||||
showLoadStatus("<span style='color:#55C175;'>Skipping</span> table '".$tb->name."' (table already exists)");
|
||||
$qr= true;
|
||||
}else{
|
||||
showLoadStatus("<span style='color:#B80400;'>Replacing</span> table '".$tb->name."'");
|
||||
$r= $p->dbmsObj->removeTable($con, $tb->name);
|
||||
if(!$r)
|
||||
{
|
||||
throw new Exception('Couldn\'t drop table '.$tb->name);
|
||||
exit;
|
||||
}
|
||||
$qr= $p->dbmsObj->query($con, $tb->DDL);
|
||||
$qr= true;
|
||||
}
|
||||
}else{
|
||||
showLoadStatus("<span style='color:#55C175;'>Creating table </span>'".$tb->name."'");
|
||||
$qr= $p->dbmsObj->query($con, $tb->DDL);
|
||||
}
|
||||
|
||||
if(!$qr)
|
||||
{
|
||||
showLoadStatus("Error when creating the table '".$tb->name."'");
|
||||
echo $p->dbmsObj->getLastError($con);
|
||||
exit;
|
||||
}
|
||||
next($t);
|
||||
}
|
||||
|
||||
showLoadStatus('Refering tables and foreign keys');
|
||||
for($i=0, $j=sizeof($p->fkDDL); $i<$j; $i++)
|
||||
{
|
||||
//echo $p->fkDDL[$i].'<br/>';
|
||||
$p->dbmsObj->query($con, $p->fkDDL[$i]);
|
||||
}
|
||||
}
|
||||
showLoadStatus("<b>Finished</b>, the project's been generated".((isset($_POST['database_pref']))? " <b><a href='JavaScript:top.Mind.Project.SeeCurrentUserFiles()'>here</a></b>": ''), 100);
|
||||
|
||||
echo "<script>
|
||||
top.document.getElementById('currentVersionLabel').innerHTML= '[".$p->version[0].".".$p->version[1].".".$p->version[2]."]';
|
||||
top.Mind.Project.attributes.version= ".$p->version[0].";
|
||||
top.Mind.Project.attributes.subVersion= ".$p->version[1].";
|
||||
top.Mind.Project.attributes.update= ".$p->version[2].";
|
||||
</script>";
|
||||
}
|
||||
exit;
|
||||
?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
$_GET['page']= urlencode(addslashes(strip_tags($_GET['page'])));
|
||||
?>
|
||||
<table style='width:100%;
|
||||
height:100%;'>
|
||||
<tr style='border-bottom:solid 1px #bbb;'>
|
||||
<td style='height:25px;border-bottom:solid 1px #666;vertical-align:top;'>
|
||||
<input type='button'
|
||||
value='<<'
|
||||
class='ui-state-default ui-corner-all'
|
||||
onclick="helpTopicsContent.history.go(-1);"/>
|
||||
<input type='button'
|
||||
value='>>'
|
||||
class='ui-state-default ui-corner-all'
|
||||
onclick="helpTopicsContent.history.go(+1);"/>
|
||||
<input type='text'
|
||||
id='searchInput'/>
|
||||
<img src='images/search_for.png'
|
||||
style='cursor:pointer;'
|
||||
onclick="document.getElementById('helpTopicsContent').src= 'http://docs.thewebmind.org/index.php?title=Special%3ASearch&search='+document.getElementById('searchInput').value+'&go=Go'"/>
|
||||
<img src='images/home.png'
|
||||
style='cursor:pointer;'
|
||||
onclick="document.getElementById('helpTopicsContent').src= 'http://docs.thewebmind.org/index.php?title=Guia-do-desenvolvedor'"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<iframe name='helpTopicsContent'
|
||||
id='helpTopicsContent'
|
||||
src='http://docs.thewebmind.org/index.php?title=<?php
|
||||
echo ($_GET['page'] == 'false')? 'Guia-do-desenvolvedor': $_GET['page'];
|
||||
?>'
|
||||
style='width:100%;
|
||||
height:100%;
|
||||
border:solid 1px #66a;'
|
||||
frameborder='0'
|
||||
border='none'></iframe>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,6 @@
|
||||
<iframe style='width:100%;
|
||||
height:100%;
|
||||
border:none;'
|
||||
frameborder='0'
|
||||
src="{MIND['home_page']}">
|
||||
</iframe>
|
||||
@@ -0,0 +1,568 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>theWebMind(s) - 2.0</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link rel="shortcut icon" href="favico.png"/>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mind.ui.js"></script><!-- Mind -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/jquery.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/jquery.ui.all.js"></script><!-- jQuery -->
|
||||
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/jquery.metadata.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/json.js"></script><!-- jSon -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/accelerators.js"></script><!-- Menus -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mbMenu.js"></script><!-- Menus -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/jquery.hoverIntent.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/grow/jquery.blockui.js"></script><!-- jQuery -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/jquery.ui.wizard.js"></script><!-- jQuery -->
|
||||
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/tooltip.js"></script><!-- Mind ToolTips -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/coockies.js"></script><!-- Mind Cookies -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mind.default.js"></script><!-- Mind -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mind.plugins.js"></script><!-- Mind -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mind.project.js"></script><!-- Mind -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mind.mindeditor.js"></script><!-- Mind -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mind.data_dictionary.js"></script><!-- Mind -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mind.tooltip.js"></script><!-- Mind -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mind.update.js"></script><!-- Mind -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/mind.der.js"></script><!-- Mind -->
|
||||
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/colorpicker.js"></script><!-- ColorPicker -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/eye.js"></script><!-- ColorPicker -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/layout.js"></script><!-- ColorPicker -->
|
||||
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/base64.js"></script><!-- canvas -->
|
||||
<script type="text/javascript" src="{?$_MIND['scriptSrc']}/canvas2image.js"></script><!-- canvas -->
|
||||
|
||||
<!-- Styles -->
|
||||
|
||||
<link rel="stylesheet" href="{?$_MIND['styleSrc']}/colorpicker.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="{?$_MIND['styleSrc']}/menu.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="{?$_MIND['styleSrc']}/layout.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="{?$_MIND['styleSrc']}/default.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="{?$_MIND['styleSrc']}/theme/ui.all.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="{?$_MIND['styleSrc']}/mind.lang_editor.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="{?$_MIND['styleSrc']}/mind.ddl.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="{?$_MIND['styleSrc']}/mind.datadictionary.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="{?$_MIND['styleSrc']}/mind.erd.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="{?$_MIND['styleSrc']}/mind.tree.css" media="screen" />
|
||||
|
||||
|
||||
|
||||
<!-- Execution -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
Mind.Recent.Init();
|
||||
Mind.Utils.SetDocumentDefaults();
|
||||
Mind.Progress.Init();
|
||||
Mind.Progress.Increment();
|
||||
Mind.Properties.path = "{?$_MIND['fwComponents']}";
|
||||
Mind.Properties.pluginPath = "{?$_MIND['pluginDir']}";
|
||||
Mind.Properties.scriptsPath = "{?$_MIND['scriptSrc']}";
|
||||
Mind.Properties.stylesPath = "{?$_MIND['styleSrc']}";
|
||||
Mind.Properties.showDeveloperMenu = '{?$_MIND['showDeveloperMenu']}';
|
||||
Mind.Properties.imagesPath = "{?$_MIND['imageDir']}";
|
||||
Mind.Panels.Init();
|
||||
$.getScript(Mind.Properties.scriptsPath + "/mind.components.js");
|
||||
$.getScript(Mind.Properties.scriptsPath + "/mind.menu.js");
|
||||
Mind.ToolTip.Init();
|
||||
Mind.Menus.Init();
|
||||
$("#mindEditorTool .tabs").tabs();
|
||||
Mind.Theme.Load();
|
||||
setTimeout(function(){
|
||||
Mind.Plugins.Load();
|
||||
}, 2000);
|
||||
Mind.ImagePreLoader.Call();
|
||||
|
||||
Mind.Theme.LoadCurrentTheme();
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body leftmargin='0' topmargin='0' rightmargin='0' bottommargin='0' scroll="no" style='margin:0px;padding:0px;'>
|
||||
<div id='colorPickerWrapper' class="wrapper"><p id="colorpickerHolder"></p></div>
|
||||
<div id='blocker'
|
||||
style='width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
z-index: 999999;
|
||||
background-color: #fff;'>
|
||||
<table align='center'
|
||||
style='width: 100%;
|
||||
height: 100%;'
|
||||
cellpadding='0'
|
||||
cellspacing='0'>
|
||||
<tr>
|
||||
<td>
|
||||
<table align='center'>
|
||||
<tr>
|
||||
<td style=" background-image: url({?$_MIND['imageDir']}/loadingGrid.gif);
|
||||
text-align: center;
|
||||
width: 408px;
|
||||
height: 306px;">
|
||||
<span id='blockerMessage'>
|
||||
<span id="welcome_mind" style='font-weight:bold;font-size: 30px; color: #666;'>Loading Mind IDE...</span><br><br>
|
||||
<div id="mind_progressbar"></div>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<table style='width: 100%;
|
||||
height: 100%;'
|
||||
cellpadding='0'
|
||||
cellspacing='0'>
|
||||
<tr>
|
||||
<td style='height: 30px;'>
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EDEDED" class='menuTopBar'>
|
||||
<tr>
|
||||
<td valign="bottom" style='border-bottom: solid 1px #dedede;'>
|
||||
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="container">
|
||||
<tr>
|
||||
<td class="myMenu" align="right">
|
||||
<!-- start horizontal menu -->
|
||||
<table class="rootVoices" cellspacing='0' cellpadding='0' border='0'>
|
||||
<tr>
|
||||
<td accelerator="F" class="rootVoice {menu: 'menu_file'}" onclick="Mind.Recent.AddToMenu();">File</td>
|
||||
<td accelerator="V" class="rootVoice {menu: 'menu_display'}">View</td>
|
||||
<td accelerator="T" class="rootVoice {menu: 'menu_tools'}">Tools</td>
|
||||
<td accelerator="M" class="rootVoice {menu: 'menu_manager'}">Manage</td>
|
||||
<td accelerator="P" class="rootVoice {menu: 'menu_plugins'}">Plugins</td>
|
||||
<td class="rootVoice {menu: 'menu_developer'}" style='display:none;' id='developerMenu'>Developer</td>
|
||||
<td accelerator="H" class="rootVoice {menu: 'menu_help'}" >Help</td>
|
||||
<td id='pluginsIcons'>
|
||||
<!-- -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- end horizontal menu -->
|
||||
<div style='display:none;'>
|
||||
{?$_MIND_MENUS}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="mind_layout_left">
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vertical-resizable-bar-left" id="vertical_resizable_bar_left">
|
||||
<table cellpadding='0' cellspacing='0' style='height:100%;'>
|
||||
<tr>
|
||||
<td>
|
||||
<div class='barBt'> </div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="mind_layout_center" style='width:10px; height:10px; overflow:auto;overflow-x:hidden'>
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vertical-resizable-bar-right" id="vertical_resizable_bar_right"
|
||||
style='display:none;'>
|
||||
<table cellpadding='0' cellspacing='0' style='height:100%;'>
|
||||
<tr>
|
||||
<td>
|
||||
<div class='barBt'> </div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="mind_layout_right"
|
||||
style='display:none;'><!-- ALTERAR AQUI para exibir o painel da direita panel['right'] right panel-->
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="horizontal-resizable-bar" id="horizontal_resizable_bar">
|
||||
<center><div class='barBt'> </div></center>
|
||||
</div>
|
||||
<div id="mind_layout_bottom">
|
||||
<div></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div style='display:none;'>
|
||||
<table id='debuggerEstructure' style='width:100%;'>
|
||||
<tr>
|
||||
<td style='width:20px;'>
|
||||
<!---->
|
||||
</td>
|
||||
<td>
|
||||
<div style='width:100%;'
|
||||
id='debuggerEstructureTree'>
|
||||
<br>
|
||||
</div>
|
||||
<div style='width:100%;display:non'
|
||||
id='debuggerEstructureCodes'>
|
||||
<center>
|
||||
<textarea style='width:49%;height:100%;'></textarea>
|
||||
<textarea style='width:49%;height:100%;'></textarea>
|
||||
</center>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--Mind Alert-->
|
||||
<div id="mind_alert" class="mind-alert"></div>
|
||||
<!--Mind Dialog-->
|
||||
<div id="mind_dialog" class="mind_dialog">
|
||||
<div id="mind_dialog_message" class="mind-message"></div>
|
||||
<div id="mind_dialog_content"></div>
|
||||
<iframe class="iframe" id="mind_dialog_iframe" src=""></iframe>
|
||||
</div>
|
||||
<!--Mind Editor Tool-->
|
||||
<div id='mindEditorTool'
|
||||
style='left:500px;top:400px;display:none;height:260px;'>
|
||||
<form style='margin:0px; padding:0px;' id='mindEditorToolForm' onsubmit='return false'>
|
||||
<div class="tabs" style='height:100%;'>
|
||||
<ul>
|
||||
<li><a href="#mindEditorTool_subtypes">Subtypes</a></li>
|
||||
<li><a href="#mindEditorTool_Entities">Entities</a></li>
|
||||
<li><a href="#mindEditorTool_Attributes">Attributes</a></li>
|
||||
</ul>
|
||||
<div id="mindEditorTool_subtypes" style='width:262px;' guia='true'>
|
||||
<table style='width:100%; height:220px;'>
|
||||
<tr>
|
||||
<td>
|
||||
<div style='height:190px;overflow-y:auto;overflow-x:hidden;'>
|
||||
<table style='width:100%;'>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Subtype
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='40' class='iptText' id='mindEditorTool_subtype_name'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Type
|
||||
</td>
|
||||
<td>
|
||||
<select id='mindEditorTool_subtype_type'>
|
||||
<option value='char'>
|
||||
char
|
||||
</option>
|
||||
<option value='varchar'>
|
||||
varchar
|
||||
</option>
|
||||
<option value='text'>
|
||||
text
|
||||
</option>
|
||||
<option value='password'>
|
||||
password
|
||||
</option>
|
||||
<option value='file'>
|
||||
file
|
||||
</option>
|
||||
<option value='smallint'>
|
||||
smallint
|
||||
</option>
|
||||
<option value='int'>
|
||||
int
|
||||
</option>
|
||||
<option value='bigint'>
|
||||
bigint
|
||||
</option>
|
||||
<option value='real'>
|
||||
real
|
||||
</option>
|
||||
<option value='time'>
|
||||
time
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Weight
|
||||
</td>
|
||||
<td style='vertical-align:middle;'>
|
||||
<input type='text' maxlength='5' style='width:50px;' class='iptText' id='mindEditorTool_subtype_weight'/>
|
||||
<input type='checkbox' id='mindEditorTool_subtype_notNull'> Not Null
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Comment
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='240' style='width:100%;' class='iptText' id='mindEditorTool_subtype_comment'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Mask
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='240' style='width:100%;' class='iptText' id='mindEditorTool_subtype_mask'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td colspan='2'>
|
||||
Options
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<textarea style='width:100%; height:70px;' class='iptText' id='mindEditorTool_subtype_options'></textarea>
|
||||
<sup>
|
||||
Use = to identify your option's values, and [ENTER] to separate them<br/>
|
||||
e.g.: value1=text that belongs to value 1<br>
|
||||
value2=text that belongs to value 2
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td class='mindEditorTool_button'>
|
||||
<input type='button'
|
||||
class='ui-state-default ui-corner-all'
|
||||
value='Apply'
|
||||
onclick="Mind.MindEditor.AddsubtypeLine();">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="mindEditorTool_Entities" style='width:262px;' guia='true'>
|
||||
<table style='width:100%; height:220px;'>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Left Entity
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='40' class='iptText' id='mindEditorTool_Entities_left'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Right Entity
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='40' class='iptText' id='mindEditorTool_Entities_right'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Relation
|
||||
</td>
|
||||
<td>
|
||||
<select id='mindEditorTool_Entities_Rel'>
|
||||
<option value='1/1'>
|
||||
1/1
|
||||
</option>
|
||||
<option value='n/n'>
|
||||
n/n
|
||||
</option>
|
||||
<option value='1/n'>
|
||||
1/n
|
||||
</option>
|
||||
<option value='n/1'>
|
||||
n/1
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td colspan='2'
|
||||
class='mindEditorTool_button'>
|
||||
<input type='button'
|
||||
class='ui-state-default ui-corner-all'
|
||||
value='Apply'
|
||||
onclick="Mind.MindEditor.AddEntityLine();">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="mindEditorTool_Attributes" style='width:262px;' guia='true'>
|
||||
<table style='width:100%; height:220px;'>
|
||||
<tr>
|
||||
<td>
|
||||
<div style='height:190px;overflow-y:auto;overflow-x:hidden;'>
|
||||
<table style='width:100%;'>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Entity
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='40' class='iptText' id='mindEditorTool_Attribute_entity'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Attribute
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='40' class='iptText' id='mindEditorTool_Attribute_att'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
SubType
|
||||
</td>
|
||||
<td>
|
||||
<select id='mindEditorTool_Attribute_subType'
|
||||
onchange="document.getElementById('attOptionsNotSubType').style.display= (this.value!= '')? 'none': '';">
|
||||
<option value=''>
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody id='attOptionsNotSubType'>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Type
|
||||
</td>
|
||||
<td>
|
||||
<select id='mindEditorTool_Attribute_type'>
|
||||
<option value='char'>
|
||||
char
|
||||
</option>
|
||||
<option value='varchar'>
|
||||
varchar
|
||||
</option>
|
||||
<option value='text'>
|
||||
text
|
||||
</option>
|
||||
<option value='password'>
|
||||
password
|
||||
</option>
|
||||
<option value='file'>
|
||||
file
|
||||
</option>
|
||||
<option value='smallint'>
|
||||
smallint
|
||||
</option>
|
||||
<option value='int'>
|
||||
int
|
||||
</option>
|
||||
<option value='bigint'>
|
||||
bigint
|
||||
</option>
|
||||
<option value='real'>
|
||||
real
|
||||
</option>
|
||||
<option value='time'>
|
||||
time
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Weight
|
||||
</td>
|
||||
<td style='vertical-align:middle;'>
|
||||
<input type='text' maxlength='5' style='width:50px;float:left;' class='iptText' id='mindEditorTool_Attribute_weight'/>
|
||||
|
||||
<input type='checkbox' id='mindEditorTool_Attribute_notNull'> Not Null
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Default
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='240' style='width:100%;' class='iptText' id='mindEditorTool_subtype_default'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Comment
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='240' style='width:100%;' class='iptText' id='mindEditorTool_Attribute_comment'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td>
|
||||
Mask
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' maxlength='240' style='width:100%;' class='iptText' id='mindEditorTool_Attribute_mask'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td colspan='2'>
|
||||
Options
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<textarea style='width:100%; height:70px;' class='iptText' id='mindEditorTool_Attribute_options'></textarea>
|
||||
<sup>
|
||||
Use = to identify your option's values, and [ENTER] to separate them<br/>
|
||||
e.g.: value1=text that belongs to value 1<br>
|
||||
value2=text that belongs to value 2
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='height:23px;'>
|
||||
<td class='mindEditorTool_button'>
|
||||
<input type='button'
|
||||
class='ui-state-default ui-corner-all'
|
||||
value='Apply'
|
||||
onclick="Mind.MindEditor.AddAttributeLine();">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id='debugBalloon'
|
||||
style='display:none;'>
|
||||
<img src='images/del.gif'
|
||||
align='right'
|
||||
onclick="Mind.Project.CloseBalloons()"/>
|
||||
<div class='balloon'>
|
||||
<br/>
|
||||
</div>
|
||||
<div class='tip'>
|
||||
</div>
|
||||
</div>
|
||||
<canvas id='oCanvas' width='600' height='400'></canvas>
|
||||
<div id='mindEditorSearch'
|
||||
style='display:none;'>
|
||||
<center>
|
||||
<input type='text' class='iptText' id='mindEditorSearch_filter' />
|
||||
<input type='button' value='Find' class='ui-state-default ui-corner-all' onclick="Mind.MindEditor.Search(this);" />
|
||||
<div style='width:100%;text-align:left;'>
|
||||
<br/>
|
||||
<img src='{?$_MIND['imageDir']}/blue_marker.png'>(full match): <span></span><br/>
|
||||
<img src='{?$_MIND['imageDir']}/light_blue_marker.png'>(partial match): <span></span>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if($_FILES)
|
||||
{
|
||||
if(
|
||||
($_FILES['fileToUpLoad']['type'] == 'package/mnd'
|
||||
||
|
||||
$_FILES['fileToUpLoad']['type'] == 'application/octet-stream')
|
||||
&&
|
||||
$_FILES['fileToUpLoad']['error'] == 0
|
||||
)
|
||||
{
|
||||
$content= file_get_contents($_FILES['fileToUpLoad']['tmp_name']);
|
||||
$_FILES['fileToUpLoad']['name']= preg_replace('/\.mnd$/', '', $_FILES['fileToUpLoad']['name']);
|
||||
if(!Project::projectExists($_FILES['fileToUpLoad']['name']))
|
||||
{
|
||||
$content= $content;
|
||||
$content= explode("?>
|
||||
", $content);
|
||||
$wmlVersion= $content[0].'?>';
|
||||
|
||||
//echo htmlentities($content[1]);
|
||||
|
||||
$content= (isset($content[1]))? $content[1]: $content[0];
|
||||
|
||||
|
||||
$ar= Array();
|
||||
$ar= JSON_decode($content, true);
|
||||
//$ar['users']= Array($_SESSION['user']['login']);
|
||||
|
||||
//print_r($ar);
|
||||
|
||||
|
||||
$p= new Project();
|
||||
$p->populate($ar['projectData']);
|
||||
$p->users= Array();
|
||||
$p->users[]= $_SESSION['user']['login'];
|
||||
$p->wml= $ar['projectData']['originalWML'];
|
||||
if($p->save())
|
||||
{
|
||||
$p->save();
|
||||
echo "<script>
|
||||
top.Mind.Component.Load('projectList',
|
||||
function (comps){
|
||||
comps= top.Mind.Component.Parse(comps);
|
||||
top.Mind.Panel['left'].Update(comps['projectList']);
|
||||
}
|
||||
);
|
||||
top.Mind.Project.Load('".$p->name."');
|
||||
top.setTimeout(function(){(top.Mind || Mind).Dialog.CloseModal()}, 500);
|
||||
//top.Mind.Dialog.CloseModal();
|
||||
</script>";
|
||||
}
|
||||
//print_r($ar['ERDs']);
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<form method='POST'
|
||||
action='<?php echo $_SERVER['PHP_SELF']; ?>'
|
||||
target='hiddenImportFrame'
|
||||
enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<table align='center'>
|
||||
<tr>
|
||||
<td>
|
||||
<input type='file' name='fileToUpLoad'/>
|
||||
</td>
|
||||
<td>
|
||||
<input type='submit'
|
||||
class='ui-state-default ui-corner-all'
|
||||
value='Import'>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
<iframe name='hiddenImportFrame' style='display:none;'>
|
||||
</iframe>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
$n= (integer)$_POST['lns'];
|
||||
$n+= 10;
|
||||
for($i=1; $i<=$n; $i++)
|
||||
{
|
||||
echo $i.'
|
||||
';
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?>
|
||||
<?php
|
||||
|
||||
if(isset($_POST["action"]))
|
||||
$_GET["action"] = $_POST["action"];
|
||||
if(isset($_POST["code"]))
|
||||
$_GET["code"] = $_POST["code"];
|
||||
|
||||
if(isset($_GET["action"]))
|
||||
{
|
||||
$action = $_GET["action"];
|
||||
switch($action){
|
||||
case "disablePlugin" :
|
||||
$pl = Plugin::getPlugin($_GET["code"],$_SESSION['user']['login']);
|
||||
$pl->disable();
|
||||
break;
|
||||
case "enablePlugin" :
|
||||
$pl = Plugin::getPlugin($_GET["code"],$_SESSION['user']['login']);
|
||||
$pl->enable();
|
||||
break;
|
||||
case "removePlugin" :
|
||||
$pl = Plugin::getPlugin($_GET["code"],$_SESSION['user']['login']);
|
||||
$pl->remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
$pl= Plugin::getPlugins();
|
||||
|
||||
?>
|
||||
<table style="width:100%;height:100%;">
|
||||
<tr>
|
||||
<td class="plugin_left_list">
|
||||
<div style='overflow:auto;height:470px;overflow-x:hidden;overflow-y:auto;'>
|
||||
<table style="width:150px">
|
||||
<?php
|
||||
foreach ($pl as $a){
|
||||
echo "<tr><td pluginName='".$a->name."' id='mind_plugin_manage_".$a->name."' class='list_plugins'>$a->name</td></tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
<td class="plugin_parent"><div class="plugin_content_list"> </div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" id="mind_manage_plugin_label_message">
|
||||
</td>
|
||||
<tr>
|
||||
</table>
|
||||
<script>
|
||||
Mind.View.Plugin.Manage();
|
||||
</script>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
|
||||
if(isset($_POST["action"]))
|
||||
$_GET["action"] = $_POST["action"];
|
||||
if(isset($_POST["code"]))
|
||||
$_GET["code"] = $_POST["code"];
|
||||
|
||||
if(isset($_GET["action"]))
|
||||
{
|
||||
$action = $_GET["action"];
|
||||
switch($action){
|
||||
case "getProject" :
|
||||
$p = Project::getProject($_POST["code"],$_SESSION['user']['login']);
|
||||
echo(json_encode($p));
|
||||
exit;
|
||||
break;
|
||||
case "saveProject" :
|
||||
$p = new Project($_GET["code"],$_SESSION['user']['login']);
|
||||
$_POST = $p->preparePost($_POST);
|
||||
$p->populate($_POST);
|
||||
if($p->save())
|
||||
echo $_GET["code"];
|
||||
else
|
||||
echo "Error";
|
||||
exit;
|
||||
break;
|
||||
case "removeProject" :
|
||||
$p = new Project($_GET["code"],$_SESSION['user']['login']);
|
||||
$p->remove($_GET["code"]);
|
||||
exit;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$p = Project::getProjects($_SESSION['user']['login']);
|
||||
?>
|
||||
<table style="width:100%;height:100%;">
|
||||
<tr>
|
||||
<td class="projet_left_list">
|
||||
<div style='overflow:auto;height:470px;overflow-x:hidden;overflow-y:auto;'>
|
||||
<table style="width:150px">
|
||||
<?php
|
||||
foreach ($p as $a){
|
||||
echo "<tr><td projectName='".$a->name."' id='mind_project_manage_".$a->name."' class='list_projects'>$a->name</td></tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
<td class="project_parent"><div class="projet_content_list"> </div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" id="mind_manage_project_label_message">
|
||||
</td>
|
||||
<tr>
|
||||
</table>
|
||||
<script>
|
||||
Mind.View.Project.Manage();
|
||||
</script>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
|
||||
if($_POST && $_GET['login'])
|
||||
{
|
||||
$u= new User($_GET['login'], $_POST['pwd']);
|
||||
if(trim($_POST['pwd']) == '' || !$u)
|
||||
{
|
||||
echo "Error: Invalid password to the current user";
|
||||
exit;
|
||||
}
|
||||
echo 'aaaaa '.$_POST['pwd'].' - '.$u->name;
|
||||
$u->populate($_POST);
|
||||
$u->save();
|
||||
exit;
|
||||
}
|
||||
|
||||
$u= User::getUsers();
|
||||
?>
|
||||
<table style="width:100%;height:100%;">
|
||||
<tr>
|
||||
<td class="user_left_list">
|
||||
<div style='overflow:auto;height:470px;overflow-x:hidden;overflow-y:auto;'>
|
||||
<table style="width:150px">
|
||||
<?php
|
||||
foreach ($u as $a){
|
||||
echo "<tr><td userPass='".$a->pwd."' userName='".$a->login."' id='mind_user_manage_".$a->login."' class='list_users'>$a->login</td></tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
<td class="user_parent"><div class="user_content_list"> </div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" id="mind_manage_user_label_message">
|
||||
</td>
|
||||
<tr>
|
||||
</table>
|
||||
<script>
|
||||
Mind.View.User.Manage();
|
||||
</script>
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?>
|
||||
<!-- FILE -->
|
||||
<div id="menu_file" class="menu">
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'580\',\'560\',\'New Project \',\'midle\',\'new_project.php\',\'form\',function(){},true)'}" shortCut="ctrl+n">New Project</a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'600\',\'170\',\'Open Project \',\'midle\',\'open_project.php\',\'form\', function(){},true)'}" shortCut="ctrl+o">Open Project</a>
|
||||
<a href="#" class="{menu: 'submenu_recent'}" id="mind_file_menu" disabled='true' shortCut="">Open Recent</a>
|
||||
<a href="#" class="{action: 'Mind.Project.Save();'}" disabled='true' projectDependence='true' shortCut="ctrl+s">Save Project</a>
|
||||
<a href="#" class="{action: 'Mind.Project.Close();'}" disabled='true' projectDependence='true' shortCut="ctrl+w">Close Project</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{action: 'Mind.View.User.New();'}">New User</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{action: 'Mind.Project.Export()'}" disabled='true' projectDependence='true' shortCut="ctrl+e">Export</a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'600\',\'170\',\'Import \',\'midle\',\'import.php\',false)'}">Import</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'405\',\'400\',\'Properties \',\'midle\',\'properties.php\')'}">Properties</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{action: 'document.location.href=\'exit.php\''}">Exit</a>
|
||||
</div>
|
||||
<!-- DISPLAY -->
|
||||
<div id="menu_display" class="menu">
|
||||
<a href="#" class="{action: '(Mind.Panel[\'left\'].opened)? Mind.Panel[\'left\'].Close():Mind.Panel[\'left\'].Open();'}">Projects pane</a>
|
||||
<a href="#" class="{action: '(Mind.Panel[\'bottom\'].opened)? Mind.Panel[\'bottom\'].Close(): Mind.Panel[\'bottom\'].Open();'}">Output pane</a>
|
||||
<!--<a href="#" class="{action: '(Mind.Panel[\'right\'].opened)?Mind.Panel[\'right\'].Close():Mind.Panel[\'right\'].Open();'}">MindApplications pane</a>-->
|
||||
<a href="#" class="{action: 'Mind.MindEditor.ShowTools(); Mind.Panel[\'bottom\'].Adjust();'}" disabled='true' projectDependence='true'>MindEditor Tools</a>
|
||||
<a href="#" class="{action: 'Mind.MindEditor.SetFull()'}" disabled='true' projectDependence='true' shortCut="F6">MindEditor Full</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{action: 'Mind.Project.SeeCurrentUserFiles()'}" disabled='true' projectDependence='true' shortCut="F10">Temp Project Files</a>
|
||||
<a href="#" class="{action: 'Mind.Project.SeeCurrentProjectFiles()'}" disabled='true' projectDependence='true' >Current Project Files</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{action: 'Mind.Panel[\'bottom\'].Focus(\'infoConfTab\')'}" disabled='true' projectDependence='true'>About</a>
|
||||
<a href="#" class="{action: 'Mind.Panel[\'bottom\'].Focus(\'DDLTab\')'}" disabled='true' projectDependence='true'>SQL-DDL</a>
|
||||
<a href="#" class="{action: 'Mind.Panel[\'bottom\'].Focus(\'ERDTab\')'}" disabled='true' projectDependence='true'>ER Diagram</a>
|
||||
<a href="#" class="{action: 'Mind.Panel[\'bottom\'].Focus(\'DDTab\')'}" disabled='true' projectDependence='true'>Data Dictionary</a>
|
||||
</div>
|
||||
<!-- TOOLS -->
|
||||
<div id="menu_tools" class="menu">
|
||||
<a href="#" class="{action: 'Mind.Project.Run()'}" disabled='true' projectDependence='true' shortCut="F5">Run/Simulate</a>
|
||||
<!--<a href="#" class="{action: 'document.title=(\'menu_1.3\')'}" disabled='true' projectDependence='true'>Debug</a>-->
|
||||
<a href="#" class="{action: 'Mind.Project.Generate()'}" disabled='true' projectDependence='true' shortCut="F7">Generate</a>
|
||||
<a href="#" class="{action: 'Mind.Project.Update()'}" disabled='true' projectDependence='true' shortCut="F8">Update</a>
|
||||
<a href="#" class="{action: 'Mind.Project.Commit()'}" disabled='true' projectDependence='true' shortCut="F9">Commit</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{menu:'submenu_options'}">Options</a>
|
||||
</div>
|
||||
<!-- MANAGE -->
|
||||
<?php
|
||||
if($_SESSION['user']['login'] == 'admin')
|
||||
{
|
||||
?>
|
||||
<div id="menu_manager" class="menu">
|
||||
<div id="manage_submenu" class="menu">
|
||||
<a href="#" class="{action: 'Mind.Menus.Manage.projects.Action()'}">Projects</a>
|
||||
<a href="#" class="{action: 'Mind.Menus.Manage.users.Action()'}">Users</a>
|
||||
<!--<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'430\',\'320\',\'Manage Languages \',\'midle\',\'manage_language.php\',\'form\')'}">Languages</a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'430\',\'320\',\'Manage DBMSs \',\'midle\',\'manage_dbms.php\',\'form\')'}">DBMSs</a>-->
|
||||
<a href="#" class="{action: 'Mind.Menus.Manage.plugins.Action()'}">Plugins</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<a href="#" class="return false">No options</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- PLUGINS -->
|
||||
<div id="menu_plugins" class="menu">
|
||||
<div id='menu_pluginsItens'>
|
||||
<a href="#" class="{action: ''}">No Plugins yet</a>
|
||||
</div>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'500\',\'340\',\'Manage Plugins \',\'midle\',\'find_plugins.php\')'}">Find Plugins</a>
|
||||
</div>
|
||||
<!-- DEVELOPER -->
|
||||
<?php
|
||||
if($_MIND['showDeveloperMenu'])
|
||||
{
|
||||
?>
|
||||
<div id="menu_developer" class="menu">
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'500\',\'340\',\'Create Plugins \',\'midle\',\'new_plugin.php\')'}">Create a Plugin</a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'500\',\'340\',\'Create/Edit Languages \',\'midle\',\'manage_languages.php\')'}">Create/Edit Languages</a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'500\',\'340\',\'Create a DBMS \',\'midle\',\'new_dbms.php\')'}">Create a DBMS</a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'500\',\'340\',\'Create a Module \',\'midle\',\'new_module.php\')'}">Create a Module</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="http://thewebmind.org/index.php#docs" target='_quot' class="{action: ''}">Developer Documentations</a>
|
||||
<a href="http://code.google.com/p/webmind/" target='_quot' class="{action: ''}">Google Codes</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- HELP -->
|
||||
<div id="menu_help" class="menu">
|
||||
<a href="#" target='_quot' class="{action: 'Mind.Help.Open()'}" shortCut="F1">Topics</a>
|
||||
<a href="http://docs.thewebmind.org" target='_quot' target='_quot' class="{action: ''}">Documentation</a>
|
||||
<a href="http://thewebmind.org/faq" target='_quot' class="{action: ''}">FAQ</a>
|
||||
<a href="http://groups.google.com/group/thewebmind" target='_quot' class="{action: ''}">Google Groups</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'405\',\'400\',\'Properties \',\'midle\',\'properties.php\')'}">About</a>
|
||||
<a href="#" class="{action: ''}">Credits</a>
|
||||
<a href="#" class="{action: ''}">Licenses</a>
|
||||
<a rel="separator"> </a>
|
||||
<a href="#" class="{action: 'Mind.UpdateItSelf()'}">Update</a>
|
||||
<a href="#" class="{action: 'Mind.FeedBack.Open()'}">Feedback</a>
|
||||
<a href="http://thewebmind.org" target='_quot' class="{}">WebSite</a>
|
||||
</div>
|
||||
<div id="submenu_options" class="menu">
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'500\',\'340\',\'My Personal Data \',\'midle\',\'personal_data.php\',\'form\',function(){},true)'}">My Personal Data</a>
|
||||
<a href="#" class="{action: 'Mind.Dialog.OpenModal(true,\'500\',\'370\',\'Options \',\'midle\',\'options.php\',\'form\', true, true)'}">Mind Options</a>
|
||||
</div>
|
||||
<div id="submenu_recent" class="menu">
|
||||
</div>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if($_POST)
|
||||
{
|
||||
if(!isset($_POST['noDataBase']) || $_POST['noDataBase'] == 'false')
|
||||
{
|
||||
?>
|
||||
<fieldset>
|
||||
<legend>
|
||||
DataBase Behavior
|
||||
</legend>
|
||||
Tables which already exist should : <br/>
|
||||
<input type='radio' name='existingTables' value='1' checked='checked'> be skipped<br/>
|
||||
<input type='radio' name='existingTables' value='2'> be replaced (all data will be lost)
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
if(isset($_POST['module']))
|
||||
{
|
||||
$l= $_MIND['fw']->getModule($_POST['module']);
|
||||
$f= strtolower($_MIND['rootDir'].$_MIND['moduleDir'].'/'.$l->name.'/data/'.$l->configPage);
|
||||
if(file_exists($f))
|
||||
{
|
||||
$c= @file_get_contents($f);
|
||||
echo $c;
|
||||
}else{
|
||||
?>
|
||||
<br/>
|
||||
The selected module has no advanced options.<br/><br/>
|
||||
<i>theWebMind 2.0</i> is about to generate a version of your project into YOUR folder.<br/>
|
||||
Press <b>Finish</b> to close this wizard and run this feature.
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
?>
|
||||
<br/>
|
||||
Only the database will be changed.<br/>
|
||||
<i>theWebMind 2.0</i> is about to generate the Data Base.<br/>
|
||||
Press <b>Finish</b> to close this wizard and run this feature.
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if($_POST)
|
||||
{
|
||||
$p= new Plugin();
|
||||
$p->populate($_POST);
|
||||
$p->save();
|
||||
$ret= $_MIND['fw']->output();
|
||||
if(trim($ret)!='')
|
||||
{
|
||||
echo "Mind.Dialog.ShowModalMessage('".$ret."', 'error')";
|
||||
}else{
|
||||
echo "parent.Mind.Dialog.CloseModal();";
|
||||
}
|
||||
//print_r($_POST);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"
|
||||
style='padding:0px;
|
||||
margin:0px;'
|
||||
target='_quot'
|
||||
method='POST'>
|
||||
<div class='pluginAddd'>
|
||||
<div id="tabs"
|
||||
style='height: 98%;'>
|
||||
<ul>
|
||||
<li><a href="#tabs-1">Info</a></li>
|
||||
<li><a href="#tabs-2">Conf</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Name
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name='name'
|
||||
class='iptText'
|
||||
required='true'
|
||||
label='Name'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Date
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name='date'
|
||||
class='iptText'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Author
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name='author'
|
||||
class='iptText'
|
||||
required='true'
|
||||
label='Author'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Link
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name='link'
|
||||
class='iptText'
|
||||
required='true'
|
||||
label='Link'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Detail
|
||||
</td>
|
||||
<td>
|
||||
<textarea name='detail'
|
||||
class='textArea'></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="tabs-2">
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
Open
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='padding-left: 25px;'>
|
||||
As
|
||||
</td>
|
||||
<td>
|
||||
<select name='openAs'>
|
||||
<option value='modal'>
|
||||
Modal
|
||||
</option>
|
||||
<option value='popup'>
|
||||
Popup
|
||||
</option>
|
||||
<option value='leftPanel'>
|
||||
Left Panel
|
||||
</option>
|
||||
<option value='rightPanel'>
|
||||
Right Panel
|
||||
</option>
|
||||
<option value='bottomPanel'>
|
||||
Bottom Panel
|
||||
</option>
|
||||
<option value='outputTab'>
|
||||
Output tab
|
||||
</option>
|
||||
<option value='bodyPanel'>
|
||||
Body Panel
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='padding-left: 25px;'>
|
||||
When:
|
||||
</td>
|
||||
<td>
|
||||
<select name='openEvent'>
|
||||
<option value='called'>
|
||||
called
|
||||
</option>
|
||||
<option value='onload'>
|
||||
theWebMind is loaded
|
||||
</option>
|
||||
<option value='openingAProject'>
|
||||
any project is opened
|
||||
</option>
|
||||
<option value='output'>
|
||||
an output is called
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='padding-left: 25px;'>
|
||||
Status:
|
||||
</td>
|
||||
<td>
|
||||
<select name='status'>
|
||||
<option value='1'>
|
||||
Active
|
||||
</option>
|
||||
<option value='0'>
|
||||
Inactive
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type='submit'>
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabs").tabs();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,333 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if($_POST)
|
||||
{
|
||||
/*$e= $_MIND['fw']->encrypt("");
|
||||
echo $e.'<br>';
|
||||
echo $_MIND['fw']->decrypt($e);
|
||||
exit;*/
|
||||
|
||||
$_POST['name']= $_MIND['fw']->fixName(strtolower($_POST['name']));
|
||||
|
||||
if(Project::projectExists($_POST['name']))
|
||||
{
|
||||
echo "Mind.Dialog.ShowError(".JSON_encode($_MIND['fw']->errorOutput(4)).")";
|
||||
exit;
|
||||
}
|
||||
$p= new Project();
|
||||
$_POST = $p->preparePost($_POST);
|
||||
$p->populate($_POST);
|
||||
|
||||
if($p->save())
|
||||
{
|
||||
//echo "Mind.Dialog.ShowMessage('Project Added');";
|
||||
echo "
|
||||
Mind.Component.Load('projectList',
|
||||
function (comps){
|
||||
comps= Mind.Component.Parse(comps);
|
||||
Mind.Panel['left'].Update(comps['projectList']);
|
||||
}
|
||||
);
|
||||
Mind.Dialog.CloseModal();
|
||||
Mind.Project.Load('".$p->name."');
|
||||
";
|
||||
//echo "Mind.Panel['left'].Update(); ";
|
||||
}
|
||||
//print_r($p);
|
||||
exit;
|
||||
}
|
||||
$op= $_MIND['fw']->loadOptions();
|
||||
?>
|
||||
<form action='<?php echo $_SERVER['PHP_SELF']; ?>' onsubmit="return false;" id='newProjectForm' method='POST' target='_quot'>
|
||||
<div class='config'
|
||||
style='width:100%;
|
||||
height:100%;'>
|
||||
<div class='errorMessageLabel'
|
||||
id='options_errorMessageLabel'
|
||||
style='display:none;'>
|
||||
<br/>
|
||||
</div>
|
||||
<br/>
|
||||
<table style='margin-bottom:4px; float:left;'>
|
||||
<tr>
|
||||
<td>
|
||||
Project Name
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="name"
|
||||
class='iptText'
|
||||
required='true'
|
||||
maxlength='30'
|
||||
label='Name'
|
||||
id='new_project_name'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Mind-Language
|
||||
</td>
|
||||
<td>
|
||||
<div class="selCont">
|
||||
<select name='lang'
|
||||
class='iptCombo'
|
||||
id="language_selectbox"
|
||||
required='true'
|
||||
label='Language'>
|
||||
<?php
|
||||
$l= $_MIND['fw']->getLanguages();
|
||||
for($i=0; $i<sizeof($l); $i++)
|
||||
{
|
||||
?>
|
||||
<option value='<?php echo $l[$i]; ?>'
|
||||
<?php
|
||||
if($op['defaultIdiom'] == $l[$i])
|
||||
echo ' selected ';
|
||||
?>>
|
||||
<?php echo $l[$i]; ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
DBMS
|
||||
</td>
|
||||
<td>
|
||||
<div class="selCont">
|
||||
<select name='dbms'
|
||||
class='iptCombo'
|
||||
id="select_dbms"
|
||||
required='true'
|
||||
label='DBMS'>
|
||||
<?php
|
||||
$l= $_MIND['fw']->getDBMSs();
|
||||
for($i=0; $i<sizeof($l); $i++)
|
||||
{
|
||||
?>
|
||||
<option value='<?php echo $l[$i]; ?>'
|
||||
<?php
|
||||
if($op['defaultDBMS'] == $l[$i])
|
||||
echo ' selected ';
|
||||
?>>
|
||||
<?php echo $l[$i]; ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td style='vertical-align:top;'>
|
||||
Users
|
||||
</td>
|
||||
<td>
|
||||
<select name='users[]'
|
||||
class='iptComboMultiple'
|
||||
required='true'
|
||||
label='DBMS'
|
||||
multiple='multiple'>
|
||||
<?php
|
||||
$l= User::getUsers();
|
||||
for($i=0; $i<sizeof($l); $i++)
|
||||
{
|
||||
?>
|
||||
<option value='<?php echo $l[$i]->login(); ?>'>
|
||||
<?php echo $l[$i]->name(); ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="tabs" style='width:500; margin-top:8px;'>
|
||||
<ul>
|
||||
<li><a href="#newProjectForm_tab1">Development DB</a></li>
|
||||
<li><a href="#newProjectForm_tab2">Production DB</a></li>
|
||||
</ul>
|
||||
<div id="newProjectForm_tab1">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Address
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="dbAddress1"
|
||||
class='iptText'
|
||||
label="Data Base's Name"
|
||||
value='localhost'>
|
||||
</td>
|
||||
<td>
|
||||
Port
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="port1"
|
||||
class='iptText'
|
||||
maxlength='4'
|
||||
style='width:50px;'
|
||||
label="Data Base's Port">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
DB Name
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="dbName1"
|
||||
class='iptText'
|
||||
label='Data Base Name'>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Root User
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="userRoot1"
|
||||
class='iptText'
|
||||
value='root'>
|
||||
</td>
|
||||
<td>
|
||||
Password
|
||||
</td>
|
||||
<td>
|
||||
<input type='password'
|
||||
name="userRootPwd1"
|
||||
class='iptPwd'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
User
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="user1"
|
||||
class='iptText'>
|
||||
</td>
|
||||
<td>
|
||||
Password
|
||||
</td>
|
||||
<td>
|
||||
<input type='password'
|
||||
name="userPwd1"
|
||||
class='iptPwd'>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="newProjectForm_tab2">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Address
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="dbAddress2"
|
||||
class='iptText'
|
||||
label="Data Base's Name">
|
||||
</td>
|
||||
<td>
|
||||
Port
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="port2"
|
||||
class='iptText'
|
||||
maxlength='4'
|
||||
style='width:50px;'
|
||||
label="Data Base's Port">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
DB Name
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="dbName2"
|
||||
class='iptText'
|
||||
label='Data Base Name'>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Root User
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="userRoot2"
|
||||
class='iptText'>
|
||||
</td>
|
||||
<td>
|
||||
Password
|
||||
</td>
|
||||
<td>
|
||||
<input type='password'
|
||||
name="userRootPwd2"
|
||||
class='iptPwd'
|
||||
style='width:100px;'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
User
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="user2"
|
||||
class='iptText'>
|
||||
</td>
|
||||
<td>
|
||||
Password
|
||||
</td>
|
||||
<td>
|
||||
<input type='password'
|
||||
name="userPwd2"
|
||||
class='iptPwd'>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
Project's Description<br>
|
||||
<textarea name='description'
|
||||
class='iptTextArea'
|
||||
style='width:505px;background-color:transparent;'></textarea>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#newProjectForm .tabs").tabs();
|
||||
//setTimeout(function(){document.getElementById('new_project_name').focus();}, 1000);
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if($_POST)
|
||||
{
|
||||
$u= new User();
|
||||
$u->populate($_POST);
|
||||
if(file_exists($_MIND['rootDir'].$_MIND['userDir'].'/'.$u->login().'/'.$_MIND['userConfFile'].'.xml'))
|
||||
{
|
||||
echo "Mind.Dialog.ShowModalMessage('The User already exists', 'error')";
|
||||
exit;
|
||||
}
|
||||
$u->save(false);
|
||||
$ret= $_MIND['fw']->output();
|
||||
if(trim($ret)!='')
|
||||
{
|
||||
echo "Mind.Dialog.ShowModalMessage('".$ret."', 'error')";
|
||||
}else{
|
||||
echo "parent.Mind.Dialog.CloseModal();";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<form action='<?php echo $_SERVER['PHP_SELF']; ?>'>
|
||||
<div class='userAdd'>
|
||||
<div class='errorMessageLabel'
|
||||
id='new_user_errorMessageLabel'
|
||||
style='display:none;'>
|
||||
<br>
|
||||
</div>
|
||||
<br>
|
||||
<table align='center'>
|
||||
<tr>
|
||||
<td>
|
||||
Name
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="name"
|
||||
class='iptText'
|
||||
required='true'
|
||||
label='Name'>
|
||||
<input type='hidden'
|
||||
name="status"
|
||||
value='1'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Age
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="age"
|
||||
class='iptText'
|
||||
style='width:40px;'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Description
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="description"
|
||||
class='iptText'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Position
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="position"
|
||||
class='iptText'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
E-mail
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="email"
|
||||
class='iptText'
|
||||
required='true'
|
||||
label='E-mail'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'
|
||||
class='iptText'>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Login
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="login"
|
||||
class='iptText'
|
||||
required='true'
|
||||
label='Login'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Password
|
||||
</td>
|
||||
<td>
|
||||
<input type='password'
|
||||
name="pwd"
|
||||
class='iptText'
|
||||
required='true'
|
||||
label='Password'>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
</script>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
|
||||
if($_POST){
|
||||
echo "
|
||||
Mind.Dialog.CloseModal();
|
||||
setTimeout(function(){
|
||||
Mind.Project.Load('".$_POST['pName']."');
|
||||
}, 1000)
|
||||
";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
<fieldset>
|
||||
<table align='center'>
|
||||
<tr>
|
||||
<td>
|
||||
Select the Project
|
||||
</td>
|
||||
<td>
|
||||
<select name='pName' required='true' label='Project'>
|
||||
<option value=''>...</option>
|
||||
<?php
|
||||
$projectList= Project::getProjects($_SESSION['user']['login']);
|
||||
foreach($projectList as $p)
|
||||
{
|
||||
echo "<option value='".$p->name."'>".$p->name."</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
or
|
||||
<input type='button'
|
||||
class='iptButton'
|
||||
value='Import'
|
||||
onclick="Mind.Dialog.OpenModal(true,'600','170','Import ','midle','import.php',false);">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,341 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$_MIND['fw']->saveOptions($_POST);
|
||||
?>
|
||||
Mind.Dialog.CloseModal();
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
|
||||
$op= $_MIND['fw']->loadOptions();
|
||||
?>
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"
|
||||
method='POST'
|
||||
onsubmit="return false"
|
||||
id='optionsForm'>
|
||||
<ul>
|
||||
<li><a href="#optionsForm_tab1">Laytout</a></li>
|
||||
<li><a href="#optionsForm_tab2">Updates</a></li>
|
||||
<li><a href="#optionsForm_tab3">I.Q.</a></li>
|
||||
</ul>
|
||||
<div id="optionsForm_tab1">
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
Default Idiom<br/>
|
||||
<select name='defaultIdiom'
|
||||
class='iptCombo'
|
||||
id="language_selectbox"
|
||||
required='true'
|
||||
label='Language'>
|
||||
<?php
|
||||
$l= $_MIND['fw']->getLanguages();
|
||||
for($i=0; $i<sizeof($l); $i++)
|
||||
{
|
||||
?>
|
||||
<option value='<?php echo $l[$i]; ?>'
|
||||
<?php
|
||||
if($op['defaultIdiom'] == $l[$i])
|
||||
echo ' selected ';
|
||||
?>>
|
||||
<?php echo $l[$i]; ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
Default DBMS<br/>
|
||||
<select name='defaultDBMS'
|
||||
class='iptCombo'
|
||||
id="select_dbms"
|
||||
required='true'
|
||||
label='DBMS'>
|
||||
<?php
|
||||
$l= $_MIND['fw']->getDBMSs();
|
||||
for($i=0; $i<sizeof($l); $i++)
|
||||
{
|
||||
?>
|
||||
<option value='<?php echo $l[$i]; ?>'
|
||||
<?php
|
||||
if($op['defaultDBMS'] == $l[$i])
|
||||
echo ' selected ';
|
||||
?>>
|
||||
<?php echo $l[$i]; ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
Theme<br/>
|
||||
<select class='iptCombo'
|
||||
label='DBMS'
|
||||
onchange="Mind.Theme.SetTheme(this.value);">
|
||||
<option value='default'>
|
||||
Default
|
||||
</option>
|
||||
<?php
|
||||
$l= $_MIND['fw']->getThemes();
|
||||
for($i=0; $i<sizeof($l); $i++)
|
||||
{
|
||||
?>
|
||||
<option value='<?php echo $l[$i]; ?>'
|
||||
<?php
|
||||
if($op['defaultDBMS'] == $l[$i])
|
||||
echo ' selected ';
|
||||
?>>
|
||||
<?php echo $l[$i]; ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Reset layout options<br/>
|
||||
(position, size and colors)
|
||||
</td>
|
||||
<td>
|
||||
<input type='button'
|
||||
class='ui-state-default ui-corner-all'
|
||||
value="Reset"
|
||||
onclick="if(confirm('Are you wure you want to reset your layout?')){Mind.Theme.Reset();}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="optionsForm_tab2">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Check for updates<br/>
|
||||
<select name='lookForUpdate' id='mindOptionsLookForUpdate' onchange="optionsFormChangeUpdate(this)">
|
||||
<option value='1'
|
||||
<?php
|
||||
if($op['lookForUpdate'] == 1)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Weekly
|
||||
</option>
|
||||
<option value='2'
|
||||
<?php
|
||||
if($op['lookForUpdate'] == 2)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Monthly
|
||||
</option>
|
||||
<option value='3'
|
||||
<?php
|
||||
if($op['lookForUpdate'] == 3)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Daily
|
||||
</option>
|
||||
<option value='never'
|
||||
<?php
|
||||
if($op['lookForUpdate'] != 1 && $op['lookForUpdate'] != 2 && $op['lookForUpdate'] != 3)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Never
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody id='optionsForm_tab2TBody'>
|
||||
<tr>
|
||||
<td>
|
||||
New versions<br/>
|
||||
<select name='actionWithNewVersion'>
|
||||
<option value='1'
|
||||
<?php
|
||||
if($op['actionWithNewVersion'] == 1)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Tell me before installing
|
||||
</option>
|
||||
<option value='2'
|
||||
<?php
|
||||
if($op['actionWithNewVersion'] == 2)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Just install it without asking me anything
|
||||
</option>
|
||||
<option value='3'
|
||||
<?php
|
||||
if($op['actionWithNewVersion'] == 3)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Install them all, and tell me after it.
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
New sub versions<br/>
|
||||
<select name='actionWithNewSubVersion'>
|
||||
<option value='1'
|
||||
<?php
|
||||
if($op['actionWithNewSubVersion'] == 1)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Tell me before installing
|
||||
</option>
|
||||
<option value='2'
|
||||
<?php
|
||||
if($op['actionWithNewSubVersion'] == 2)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Just install it without asking me anything
|
||||
</option>
|
||||
<option value='3'
|
||||
<?php
|
||||
if($op['actionWithNewSubVersion'] == 3)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Install them all, and tell me after it.
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
New updates<br/>
|
||||
<select name='actionWithNewUpdates'>
|
||||
<option value='1'
|
||||
<?php
|
||||
if($op['actionWithNewUpdates'] == 1)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Tell me before installing
|
||||
</option>
|
||||
<option value='2'
|
||||
<?php
|
||||
if($op['actionWithNewUpdates'] == 2)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Just install it without asking me anything
|
||||
</option>
|
||||
<option value='3'
|
||||
<?php
|
||||
if($op['actionWithNewUpdates'] == 3)
|
||||
echo 'selected';
|
||||
?>>
|
||||
Install them all, and tell me after it.
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="optionsForm_tab3">
|
||||
<input type='checkbox'
|
||||
<?php if(isset($op['useGlobalSynDic']) && $op['useGlobalSynDic'] == 'on') echo "checked='checked'" ?>
|
||||
name='useGlobalSynDic'/>
|
||||
Use Global Synonimous<br/>
|
||||
|
||||
<input type='checkbox'
|
||||
name='addAutomatically'
|
||||
id='addAutomatically1'
|
||||
value='global'
|
||||
<?php if(isset($op['addAutomatically']) && $op['addAutomatically'] == 'global') echo "checked='checked'" ?> />
|
||||
Add new synonymous automatically<br/>
|
||||
<input type='checkbox'
|
||||
<?php if(isset($op['useLocalSynDic']) && $op['useLocalSynDic'] == 'on') echo "checked='checked'" ?>
|
||||
name='useLocalSynDic'/>
|
||||
Use Project Synonimous<br/>
|
||||
|
||||
<input type='checkbox'
|
||||
name='addAutomatically'
|
||||
id='addAutomatically2'
|
||||
value='local'
|
||||
<?php if(isset($op['addAutomatically']) && $op['addAutomatically'] == 'local') echo "checked='checked'" ?> />
|
||||
Add new synonymous automatically<br/>
|
||||
<input type='checkbox'
|
||||
<?php if(isset($op['reportDecisions']) && $op['reportDecisions'] == 'on') echo "checked='checked'" ?>
|
||||
name='reportDecisions' />
|
||||
Report decisions<br/>
|
||||
<input type='checkbox'
|
||||
<?php if(isset($op['reportDoubts']) && $op['reportDoubts'] == 'on') echo "checked='checked'" ?>
|
||||
name='reportDoubts' />
|
||||
Report doubts<br/>
|
||||
<!-- <input type='checkbox'
|
||||
<?php if(isset($op['enableMindUniverse']) && $op['enableMindUniverse'] == 'on') echo "checked='checked'" ?>
|
||||
name='enableMindUniverse' />
|
||||
Enable Mind Universe<br/> -->
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
function optionsFormChangeUpdate(o)
|
||||
{
|
||||
if(o.value == 'never')
|
||||
{
|
||||
$('#optionsForm_tab2TBody select').attr('disabled', 'disabled');
|
||||
}else{
|
||||
$('#optionsForm_tab2TBody select').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#optionsForm").tabs();
|
||||
optionsFormChangeUpdate(document.getElementById('mindOptionsLookForUpdate'));
|
||||
|
||||
var iq= $('#optionsForm_tab3');
|
||||
var gSynDic= iq.find("[name=useGlobalSynDic]");
|
||||
var lSynDic= iq.find('[name=useLocalSynDic]');
|
||||
|
||||
if(!gSynDic.is(':checked'))
|
||||
{
|
||||
document.getElementById('addAutomatically1').disabled= 'disabled';
|
||||
document.getElementById('addAutomatically1').checked= false;
|
||||
}
|
||||
if(!lSynDic.is(':checked'))
|
||||
{
|
||||
document.getElementById('addAutomatically2').disabled= 'disabled';
|
||||
document.getElementById('addAutomatically2').checked= false;
|
||||
}
|
||||
|
||||
$('#addAutomatically2').bind('click', function(){
|
||||
if(this.checked)
|
||||
document.getElementById('addAutomatically1').checked= false;
|
||||
});
|
||||
|
||||
$('#addAutomatically1').bind('click', function(){
|
||||
if(this.checked)
|
||||
document.getElementById('addAutomatically2').checked= false;
|
||||
});
|
||||
gSynDic.bind('click', function(){
|
||||
if(this.checked)
|
||||
{
|
||||
document.getElementById('addAutomatically1').removeAttribute('disabled');
|
||||
}else{
|
||||
document.getElementById('addAutomatically1').setAttribute('disabled', 'disabled');
|
||||
}
|
||||
})
|
||||
|
||||
lSynDic.bind('click', function(){
|
||||
if(this.checked)
|
||||
{
|
||||
document.getElementById('addAutomatically2').removeAttribute('disabled');
|
||||
}else{
|
||||
document.getElementById('addAutomatically2').setAttribute('disabled', 'disabled');
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if($_POST)
|
||||
{
|
||||
if(trim($_POST['pwd'])=='')
|
||||
{
|
||||
echo "Mind.Dialog.ShowModalMessage('Invalid Current Password', 'error')";
|
||||
/*echo "parent.document.getElementById('options_errorMessageLabel').style.display='';
|
||||
parent.document.getElementById('options_errorMessageLabel').innerHTML= 'Invalid Current Password';";*/
|
||||
exit;
|
||||
}
|
||||
$u= new User();
|
||||
if($u->loadUser($_SESSION['user']['login'], $_POST['pwd']))
|
||||
{
|
||||
$u->populate($_POST);
|
||||
$u->login($_SESSION['user']['login']);
|
||||
if(trim($_POST['new_pwd'])!='')
|
||||
$u->pwd($_POST['new_pwd']);
|
||||
$ret= $_MIND['fw']->output();
|
||||
if(trim($_MIND['fw']->output())!='')
|
||||
{
|
||||
echo "Mind.Dialog.ShowModalMessage('".$_MIND['fw']->output()."', 'error')";
|
||||
exit;
|
||||
}
|
||||
$u->save(false);
|
||||
if(trim($_MIND['fw']->output())=='')
|
||||
{
|
||||
$_SESSION['user']['name'] = $u->name();
|
||||
$_SESSION['user']['login'] = $u->login();
|
||||
$_SESSION['user']['age'] = $u->age();
|
||||
$_SESSION['user']['description']= $u->description();
|
||||
$_SESSION['user']['position'] = $u->position();
|
||||
$_SESSION['user']['status'] = $u->status();
|
||||
$_SESSION['user']['email'] = $u->email();
|
||||
echo "parent.Mind.Dialog.CloseModal();";
|
||||
exit;
|
||||
}else{
|
||||
echo "Mind.Dialog.ShowModalMessage('".$_MIND['fw']->output()."', 'error')";
|
||||
}
|
||||
}else{
|
||||
echo "Mind.Dialog.ShowModalMessage('".$_MIND['fw']->output()."', 'error')";
|
||||
exit;
|
||||
}
|
||||
exit;
|
||||
}else{
|
||||
$u= new User();
|
||||
$u->populate($_SESSION['user']);
|
||||
}
|
||||
?>
|
||||
<form action='<?php echo $_SERVER['PHP_SELF']; ?>'>
|
||||
<div class='config'>
|
||||
<div class='errorMessageLabel'
|
||||
id='options_errorMessageLabel'
|
||||
style='display:none;'>
|
||||
<br>
|
||||
</div>
|
||||
<br>
|
||||
<table align='center'>
|
||||
<tr>
|
||||
<td>
|
||||
Name
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="name"
|
||||
class='iptText'
|
||||
value='<?php echo $u->name(); ?>'
|
||||
required='true'
|
||||
label='Name'>
|
||||
<input type='hidden'
|
||||
name="status"
|
||||
value='1'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Age
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="age"
|
||||
class='iptText'
|
||||
style='width:40px;'
|
||||
value='<?php echo $u->age(); ?>'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Description
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="description"
|
||||
class='iptText'
|
||||
value='<?php echo $u->description(); ?>'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Position
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="position"
|
||||
class='iptText'
|
||||
value='<?php echo $u->position(); ?>'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
E-mail
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="email"
|
||||
class='iptText'
|
||||
required='true'
|
||||
label='E-mail'
|
||||
value='<?php echo $u->email(); ?>'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'
|
||||
class='iptText'>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Login
|
||||
</td>
|
||||
<td>
|
||||
<input type='text'
|
||||
name="login"
|
||||
class='iptText'
|
||||
disabled='true'
|
||||
required='true'
|
||||
label='Login'
|
||||
value='<?php echo $u->login(); ?>'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Current password
|
||||
</td>
|
||||
<td>
|
||||
<input type='password'
|
||||
name="pwd"
|
||||
required='true'
|
||||
label='Current Password'
|
||||
class='iptText'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
New password
|
||||
</td>
|
||||
<td>
|
||||
<input type='password'
|
||||
name="new_pwd"
|
||||
class='iptText'>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
$projectList= Project::getProjects($_SESSION['user']['login']);
|
||||
echo ($projectList)? jSon_encode($projectList): 'false';
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require_once('../../config/mind.php');
|
||||
require_once('../../'.$_MIND['framework']);
|
||||
require_once('../../'.$_MIND['header']);
|
||||
|
||||
|
||||
$current= $_MIND['fw']->loadXML($_MIND['rootDir'].'config/current.xml');
|
||||
//print_r($current->mindFiles[0]['version']);
|
||||
$vs= $current->mindFiles[0]['version'];
|
||||
// $vs= implode($vs);
|
||||
?>
|
||||
<img src='<?php echo $_MIND['imageDir'].'/logo_light.png'; ?>'><br/>
|
||||
<div>
|
||||
<h2>theWebMind <?php echo $vs; ?></h2><br/>
|
||||
WebPage: <a href='http://thewebmind.org' target='_quot'>http://thewebmind.org</a><br/>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if($_POST)
|
||||
{
|
||||
$data= json_decode(($_POST['json']));
|
||||
if(!$data)
|
||||
{
|
||||
$data= json_decode((stripslashes($_POST['json'])));
|
||||
if(!$data)
|
||||
die('invalid Object');
|
||||
}
|
||||
|
||||
$data= $_MIND['fw']->objectToArray($data);
|
||||
|
||||
$data['subversion']= $data['version'][1];
|
||||
$data['update']= $data['version'][2];
|
||||
$data['version']= $data['version'][0];
|
||||
|
||||
$p= new Project($data['name'], $_SESSION['user']['login']);
|
||||
|
||||
$p->populate($data);
|
||||
|
||||
if($p->run())
|
||||
{
|
||||
echo JSON_encode($p->knowledge);
|
||||
}else{
|
||||
echo JSON_encode($_MIND['fw']->errorOutput(3));
|
||||
}
|
||||
}else{
|
||||
echo 'Not allowed';
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
if($_POST)
|
||||
{
|
||||
$data= json_decode($_POST['json']);
|
||||
if(!$data)
|
||||
$data= json_decode(stripslashes($_POST['json']));
|
||||
|
||||
$data= $_MIND['fw']->objectToArray($data);
|
||||
|
||||
$data['subVersion']= $data['version'][1];
|
||||
$data['update']= $data['version'][2];
|
||||
$data['version']= $data['version'][0];
|
||||
|
||||
$p= new Project($data['name'], $_SESSION['user']['login']);
|
||||
$p->populate($data);
|
||||
//print_r($p);
|
||||
if($p->save())
|
||||
{
|
||||
echo '1';
|
||||
}else{
|
||||
echo JSON_encode($_MIND['fw']->errorOutput(3));
|
||||
}
|
||||
}else{
|
||||
echo 'Not allowed';
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
include('../../config/mind.php');
|
||||
include('../../'.$_MIND['framework']);
|
||||
include('../../'.$_MIND['header']);
|
||||
?><?php
|
||||
$p= new Project($_SESSION['currentProject'], $_SESSION['user']['login']);
|
||||
|
||||
$curVersion= $_MIND['fw']->currentVersion($p);
|
||||
|
||||
if($curVersion['subVersion'] <= $p->version[1])
|
||||
{
|
||||
?>
|
||||
<center>
|
||||
<div style='border:solid 1px #666;padding:20px;margin:8px; background-color:#cfc;color:#393;font-weight:bold;'>
|
||||
<img src='<?php echo $_MIND['imageDir'].'/'; ?>visto.png' />
|
||||
Your project is up to date.
|
||||
</div>
|
||||
<br/>
|
||||
<input type='button'
|
||||
value='Ok'
|
||||
class='ui-state-default ui-corner-all'
|
||||
style='height:26px;'
|
||||
onclick="Mind.Dialog.CloseModal();"/>
|
||||
<center>
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
$dir= $_MIND['rootDir'].$_MIND['publishDir'].'/'.$p->name;
|
||||
if($p->hasProject($p->name))
|
||||
{
|
||||
$dir.= '/mind/mind_code.php';
|
||||
?>
|
||||
<div style='border:solid 1px #666;padding:4px;margin:8px;text-align:center; background-color:#f99;color:#fff;font-weight:bold;'>
|
||||
Your project is out of date !!
|
||||
</div>
|
||||
<div style='padding-left:15px;'>
|
||||
Currently in version <span id='newUpToDateVersion'><?php echo $curVersion['version'].'.'.$curVersion['subVersion'].'.'.$curVersion['update'];?></span><br/>
|
||||
With the following code:<br/>
|
||||
</div>
|
||||
<div style='background-color:white;border:solid 1px #666;padding:8px;margin:8px;height:265px;overflow:auto;'>
|
||||
<pre id='newUpToDateCode'><?php
|
||||
echo file_get_contents($dir);
|
||||
?></pre>
|
||||
</div>
|
||||
<center>
|
||||
<input type='button'
|
||||
value='Proceed'
|
||||
class='ui-state-default ui-corner-all'
|
||||
style='height:26px;'
|
||||
onclick="Mind.Project.ConfirmUpdate()"/>
|
||||
</center>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,897 @@
|
||||
<?php
|
||||
// here, we'll simply prepare the url to find the root directory wherever we are
|
||||
$slashes= '';
|
||||
if(!is_dir('restrict'))
|
||||
{
|
||||
$curDir= 'config/mind.php';
|
||||
$slashes= '';
|
||||
while(!file_exists($curDir))
|
||||
{
|
||||
$curDir= '../'.$curDir;
|
||||
$slashes.= '../';
|
||||
}
|
||||
}
|
||||
$_MIND['rootDir']= $slashes;
|
||||
|
||||
// this function does nothing. It's called when you want some error to be neutralized
|
||||
function _MINDNeutralizeError($errno, $errstr, $errfile, $errline)
|
||||
{}
|
||||
|
||||
/**
|
||||
* CLass: Mind
|
||||
* this is the framework itself
|
||||
* @package framework
|
||||
* @author Felipe Nascimento
|
||||
*/
|
||||
class Mind
|
||||
{
|
||||
private $output;
|
||||
|
||||
/**
|
||||
* this method is used to force the utput to the client
|
||||
* @author Felipe Nascimento
|
||||
* @name forceFlush
|
||||
* @return void
|
||||
*/
|
||||
function forceFlush()
|
||||
{
|
||||
ob_start();
|
||||
ob_end_clean();
|
||||
flush();
|
||||
set_error_handler('_MINDNeutralizeError');
|
||||
ob_end_flush();
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
/**
|
||||
* this mathod will remove directories, even if they are not empty. It works recursively
|
||||
* @author Felipe Nascimento
|
||||
* @name removeDir
|
||||
* @param String $dir
|
||||
* @return void
|
||||
*/
|
||||
function removeDir($dir)
|
||||
{
|
||||
$dir .= "/";
|
||||
$files = glob($dir . '*', GLOB_MARK);
|
||||
foreach($files as $file){
|
||||
if($file != ".svn"){
|
||||
if(substr( $file, -1 ) == '/')
|
||||
delTree($file);
|
||||
else
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
rmdir($dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* this method is called to build the main client structure, replaceing specific tags applying values to the template
|
||||
* @author Felipe Nascimento
|
||||
* @name apply
|
||||
* @param String $str
|
||||
* @return String $str
|
||||
*/
|
||||
function apply($str)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
reset($_MIND);
|
||||
foreach($_MIND as $cur)
|
||||
{
|
||||
$tmp= (isset($_MIND[key($_MIND)]))? $_MIND[key($_MIND)]: false;
|
||||
if(is_string($tmp) || is_bool($tmp))
|
||||
$str= str_replace('{?$_MIND[\''.key($_MIND).'\']}', $tmp, $str);
|
||||
next($_MIND);
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* this method does not really include the file, but loads its results.
|
||||
* instead of running the included file where it was included, it loads only the output of that script
|
||||
* @author Felipe Nascimento
|
||||
* @name import
|
||||
* @param String $url
|
||||
* @return String $scriptOutput
|
||||
*/
|
||||
function import($url)
|
||||
{
|
||||
ob_start();
|
||||
include($url);
|
||||
$scriptOutput= ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $scriptOutput;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* smaller alias for simplexml_load_file
|
||||
* @author Felipe Nascimento
|
||||
* @name loadXML
|
||||
* @param String $fileURL
|
||||
* @return SimpleXMLObject $obj
|
||||
*/
|
||||
function loadXML($fileURL)
|
||||
{
|
||||
return simplexml_load_file($fileURL);
|
||||
}
|
||||
|
||||
/**
|
||||
* with this function you can create a new XML file already with the required patterns applied
|
||||
* This method returns a SimpleXML Object. If the file doesn't exist, it will be created
|
||||
* E.g.: $myXML= $_Mind['fw']->mkXML('my_xml.xml');
|
||||
* $myXML->addChild('my_tag');
|
||||
* @author Felipe Nascimento
|
||||
* @name mkXML
|
||||
* @param String $fileURL
|
||||
* @return SimpleXMLObject $obj
|
||||
*/
|
||||
function mkXML($fileURL)
|
||||
{
|
||||
$f = fopen($fileURL,"w+");
|
||||
fwrite($f,'<?xml version="1.0" encoding="UTF-8" ?><root></root>');
|
||||
fclose($f);
|
||||
return simplexml_load_file($fileURL);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method saves the current situation of a SimpleXMLObject to a file
|
||||
* as XML. If the file doesn't exist, it will be created
|
||||
* @author Felipe Nascimento
|
||||
* @name saveXML
|
||||
* @param SimpleXMLObject $xml
|
||||
* @param String $fileURL
|
||||
* @return boolean
|
||||
*/
|
||||
function saveXML($xml, $fileURL)
|
||||
{
|
||||
$f = fopen($fileURL, "w+");
|
||||
fwrite($f, $xml->asXML());
|
||||
if(fclose($f))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method can be used to encode the pwd. If this algorithm should change, we can simply change this method
|
||||
* @author Felipe Nascimento
|
||||
* @name getEncodedPwd
|
||||
* @param String $pwd
|
||||
* @return MD5_String
|
||||
*/
|
||||
function getEncodedPwd($pwd)
|
||||
{
|
||||
return md5($pwd);
|
||||
}
|
||||
|
||||
/**
|
||||
* You can use this method to filter some special chars. Any new future special char can be added here
|
||||
* It also replaces any numbers to "_"
|
||||
* @author Felipe Nascimento
|
||||
* @name getEncoded
|
||||
* @param String $n
|
||||
* @return String
|
||||
*/
|
||||
function getEncoded($n)
|
||||
{
|
||||
$n= utf8_decode($n);
|
||||
$n= addslashes(strip_tags(preg_replace('/[\!\@\#\$\%\&\*\(\)\\_\-\=\+\^\~\,\.\{\[\]\}\?\"\']\;\/\:/', '', $n)));
|
||||
$n= preg_replace('/[áàâã]/i', 'a', $n);
|
||||
$n= preg_replace('/[éèêẽ]/i', 'e', $n);
|
||||
$n= preg_replace('/[íìîĩï]/i', 'i', $n);
|
||||
$n= preg_replace('/[óòôõö]/i', 'o', $n);
|
||||
$n= preg_replace('/[úùûũü]/i', 'u', $n);
|
||||
$n= preg_replace('/ç/i', 'c', $n);
|
||||
$n= preg_replace('/ñ/i', 'n', $n);
|
||||
//$n= preg_replace('/^[0-9]/', '_', $n);
|
||||
return $n;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is responsable to replace the special tags and prepare all the client interface applying the theme and template
|
||||
* The resulted output is set to $this->output property;
|
||||
* @author Felipe Nascimento
|
||||
* @name mountIde
|
||||
* @return void
|
||||
*/
|
||||
function mountIde()
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$ide= file_get_contents($_MIND['fwComponents'].'/ide.php');
|
||||
$ide= $this->apply($ide);
|
||||
$menus= file_get_contents($_MIND['fwComponents'].'/menus.php');
|
||||
$ide= str_replace('{?$_MIND_MENUS}', $menus, $ide);
|
||||
$this->output.= $ide.'<br>';
|
||||
}
|
||||
|
||||
/**
|
||||
* It echoes and returns the prepared output for interface
|
||||
* @author Felipe Nascimento
|
||||
* @name output
|
||||
* @return String
|
||||
*/
|
||||
function output()
|
||||
{
|
||||
echo $this->output;
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ouputs a patternized message of error, to be treated by the javascript framework running on the client side
|
||||
* @author Felipe Nascimento
|
||||
* @name errorOutput
|
||||
* @param Integer $erCod
|
||||
* @return ErrorObject
|
||||
*/
|
||||
function errorOutput($erCod)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
include($_MIND['rootDir'].'/'.$_MIND['errorMessagesFile']);
|
||||
return new Error($erCod);
|
||||
}
|
||||
|
||||
/**
|
||||
* logs the message to the correct log file
|
||||
* use the following types:
|
||||
* "server conf" due to any requirement the server has not satisfied
|
||||
* "error", "warning" or "general" when it was not defined or specified
|
||||
* "encoding" when related to localization, idiom, charset or timezone
|
||||
* @author Felipe Nascimento
|
||||
* @name log
|
||||
* @param Strig $message
|
||||
* @param Strig $type server conf/error/warning/general/enconding
|
||||
* @return boolean
|
||||
*/
|
||||
function log($message, $type)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
if(!preg_match('/log|server conf|error|warning|general|encoding/', $type))
|
||||
{
|
||||
$this->log('Impossible to log message! Invalid error type.', 'log');
|
||||
return false;
|
||||
}
|
||||
$f= fopen($_MIND['rootDir'].'/'.$_MIND['logDirectory'].'/'.$type.'.log', 'a');
|
||||
fwrite($f, $_SESSION['user']['login'].' -- '.date('M/d/Y H:i:s').': '.$message."\n");
|
||||
fclose($f);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method also transmits the error to the client side, but calling a specific method from the js MindFramework
|
||||
* to treat the error
|
||||
* @author Felipe Nascimento
|
||||
* @name ouputPane
|
||||
* @param String/ErrorObject $m
|
||||
* @param boolean $flag -- indicates a fatal message, to end the script
|
||||
* @return numeric Array
|
||||
*/
|
||||
function outputPane($m, $flag= false)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$this->output.= $m.'<br>';
|
||||
if(is_string($m))
|
||||
echo "Mind.Dialog.ShowMessage('".$m."'); ";
|
||||
else
|
||||
echo "Mind.Dialog.ShowError(".JSON_encode($_MIND['fw']->errorOutput(8))."); ";
|
||||
if(!$flag)
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Here, we will load all the extra configuration files indicated into our conf file
|
||||
* @author Felipe Nascimento
|
||||
* @name loadExternal
|
||||
* @return boolean
|
||||
*/
|
||||
function loadExternal()
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
reset($_MIND['load']);
|
||||
while($m= current($_MIND['load']))
|
||||
{
|
||||
if(!include($_MIND['load'][key($_MIND['load'])]))
|
||||
{
|
||||
$this->outputPane("Error when trying to load the config file <b>".key($_MIND['load'])."</b>");
|
||||
return false;
|
||||
}
|
||||
next($_MIND['load']);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @author Felipe Nascimento
|
||||
* @name _construct
|
||||
* @return void
|
||||
*/
|
||||
public function _construct()
|
||||
{
|
||||
$this->output= '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Another different option to apply filters to our received data
|
||||
* This method add slashes the our quots and clears all the tags
|
||||
* @author Felipe Nascimento
|
||||
* @name filter
|
||||
* @param String $str
|
||||
* @return String
|
||||
*/
|
||||
public function filter($str)
|
||||
{
|
||||
return addslashes(strip_tags($str));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of possible idioms
|
||||
* @author Felipe Nascimento
|
||||
* @name getLanguages
|
||||
* @return Array
|
||||
*/
|
||||
function getLanguages()
|
||||
{
|
||||
$c=0;
|
||||
GLOBAL $_MIND;
|
||||
$d = dir($_MIND['rootDir'].$_MIND['languageDir']);
|
||||
$ar= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0, 1) != '.' && is_dir($_MIND['rootDir'].$_MIND['languageDir']."/".$entry))
|
||||
{
|
||||
$ar[]= $entry;
|
||||
}
|
||||
$c++;
|
||||
}
|
||||
$d->close();
|
||||
return $ar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of avaliable Users
|
||||
* @author Felipe Nascimento
|
||||
* @name getUsers
|
||||
* @return UserObject Collection
|
||||
*/
|
||||
function getUsers()
|
||||
{
|
||||
return User::getUsers();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the registered DBMSs
|
||||
* @author Felipe Nascimento
|
||||
* @name getDBMS
|
||||
* @return Array
|
||||
*/
|
||||
function getDBMSs()
|
||||
{
|
||||
$c=0;
|
||||
GLOBAL $_MIND;
|
||||
$d = dir($_MIND['rootDir'].$_MIND['dbmsDir']);
|
||||
$ar= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0, 1) != '.' && is_dir($_MIND['rootDir'].$_MIND['dbmsDir'].'/'.$entry))
|
||||
{
|
||||
$ar[]= $entry;
|
||||
}
|
||||
$c++;
|
||||
}
|
||||
$d->close();
|
||||
return $ar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to copy whole directories. Special use to update your project related to the teamwork
|
||||
* @author Felipe Nascimento
|
||||
* @name updateCopy
|
||||
* @param String $source
|
||||
* @param String $dest
|
||||
* @return boolean
|
||||
*/
|
||||
function updateCopy($source, $dest)
|
||||
{
|
||||
if (is_file($source))
|
||||
{
|
||||
$c = copy($source, $dest);
|
||||
chmod($dest, 0777);
|
||||
return $c;
|
||||
}
|
||||
// Make destination directory
|
||||
if(!is_dir($dest))
|
||||
{
|
||||
$oldumask = umask(0);
|
||||
mkdir($dest, 0777);
|
||||
umask($oldumask);
|
||||
}
|
||||
// Loop through the folder
|
||||
$dir = dir($source);
|
||||
while(false !== $entry = $dir->read())
|
||||
{
|
||||
// Skip pointers
|
||||
if ($entry == "." || $entry == "..")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// Deep copy directories
|
||||
if ($dest !== "$source/$entry")
|
||||
{
|
||||
$this->copyDir("$source/$entry", "$dest/$entry");
|
||||
}
|
||||
}
|
||||
// Clean up
|
||||
$dir->close();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will copy the whole directory, recursively
|
||||
* but it is focused to the "generate project" tool
|
||||
* @author Felipe Nascimento
|
||||
* @name copyDir
|
||||
* @param String $source
|
||||
* @param String $dest
|
||||
* @param [String $flag]
|
||||
* @return boolean
|
||||
*/
|
||||
function copyDir($source, $dest, $flag= false)
|
||||
{
|
||||
// Simple copy for a file
|
||||
if($flag)
|
||||
{
|
||||
$s= '...'.substr($source, -30);
|
||||
showLoadStatus("Copying ".$s, $_SESSION['currentPerc']);
|
||||
}
|
||||
if (is_file($source))
|
||||
{
|
||||
$c = copy($source, $dest);
|
||||
chmod($dest, 0777);
|
||||
return $c;
|
||||
}
|
||||
// Make destination directory
|
||||
if(!is_dir($dest))
|
||||
{
|
||||
$oldumask = umask(0);
|
||||
mkdir($dest, 0777);
|
||||
umask($oldumask);
|
||||
}
|
||||
// Loop through the folder
|
||||
$dir = dir($source);
|
||||
while(false !== $entry = $dir->read())
|
||||
{
|
||||
// Skip pointers
|
||||
if ( in_array($entry, array(".","..",".svn") ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// Deep copy directories
|
||||
if ($dest !== "$source/$entry")
|
||||
{
|
||||
$this->copyDir("$source/$entry", "$dest/$entry", $flag);
|
||||
}
|
||||
}
|
||||
// Clean up
|
||||
$dir->close();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes recusrively a directory
|
||||
* @author thiago <erkethan@free.fr>
|
||||
* @name deleteDirectory
|
||||
* @param String $dir
|
||||
* @return boolean
|
||||
* [EDITOR NOTE: "Credits to erkethan at free dot fr." - thiago]
|
||||
*/
|
||||
function deleteDirectory($dir)
|
||||
{
|
||||
if(!file_exists($dir))
|
||||
return true;
|
||||
if(!is_dir($dir) || is_link($dir))
|
||||
return unlink($dir);
|
||||
foreach(scandir($dir) as $item)
|
||||
{
|
||||
if ($item == '.' || $item == '..')
|
||||
continue;
|
||||
if(!$this->deleteDirectory($dir . "/" . $item))
|
||||
{
|
||||
chmod($dir . "/" . $item, 0777);
|
||||
if(!$this->deleteDirectory($dir . "/" . $item))
|
||||
return false;
|
||||
};
|
||||
}
|
||||
return rmdir($dir);
|
||||
// [EDITOR NOTE: "Credits to erkethan at free dot fr." - thiago]
|
||||
}
|
||||
|
||||
/**
|
||||
* Add here, some rules to filter specific information of the pushed info from client
|
||||
* @author Felipe Nascimento
|
||||
* @name treatClientInfo
|
||||
* @param String $clientInfo
|
||||
* @return String
|
||||
*/
|
||||
function treatClientInfo($clientInfo)
|
||||
{
|
||||
return $clientInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* A method to decrypt data. For now, it does nothing, but you can add specification here
|
||||
* @author Felipe Nascimento
|
||||
* @name decrypt
|
||||
* @param String $text
|
||||
* @return String
|
||||
*/
|
||||
function decrypt($text)
|
||||
{
|
||||
return $text;//base64_decode(convert_uudecode($text));
|
||||
}
|
||||
|
||||
/**
|
||||
* A method to encrypt data. For now, it does nothing, but you can add specification here
|
||||
* @author Felipe Nascimento
|
||||
* @name encrypt
|
||||
* @param String $text
|
||||
* @return String
|
||||
*/
|
||||
function encrypt($text)
|
||||
{
|
||||
return $text;//convert_uuencode(base64_encode($text));
|
||||
}
|
||||
|
||||
/**
|
||||
* Transletes an Object into an Array
|
||||
* It is basicaly an alias to get_object_vars
|
||||
* @author Felipe Nascimento
|
||||
* @name objectToArray
|
||||
* @param Object $obj
|
||||
* @return Array
|
||||
*/
|
||||
function objectToArray($obj)
|
||||
{
|
||||
return get_object_vars($obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a SimpleXML object into an Array
|
||||
* @author Felipe Nascimento
|
||||
* @name decrypt
|
||||
* @param String $text
|
||||
* @return String
|
||||
*/
|
||||
function xmlObjectToArray($obj)
|
||||
{
|
||||
return get_object_vars($obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the list of users
|
||||
* @author Felipe Nascimento
|
||||
* @name getUserList
|
||||
* @return Array
|
||||
*/
|
||||
function getUsersList($x='')
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
|
||||
$dir= $x.$_MIND['rootDir'].$_MIND['userDir'];
|
||||
$d = dir($dir);
|
||||
|
||||
$users= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0,1) !='.')
|
||||
array_push($users, $entry);
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the list of avaliable Modules
|
||||
* @author Felipe Nascimento
|
||||
* @name getModulesList
|
||||
* @return Array
|
||||
*/
|
||||
function getModulesList($x='')
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
|
||||
$dir= $x.$_MIND['rootDir'].$_MIND['moduleDir'];
|
||||
$d = dir($dir);
|
||||
|
||||
$modules= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0,1) !='.')
|
||||
array_push($modules, $entry);
|
||||
}
|
||||
return $modules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a specific module
|
||||
* @author Felipe Nascimento
|
||||
* @name getModule
|
||||
* @param String $mName
|
||||
* @return ModuleObject
|
||||
*/
|
||||
function getModule($mName)
|
||||
{
|
||||
$m= new Module($mName);
|
||||
return $m;
|
||||
}
|
||||
|
||||
/**
|
||||
* an alternative to the default output, to help when deugging
|
||||
* @author Felipe Nascimento
|
||||
* @name printR
|
||||
* @param mixed $var
|
||||
* @return void
|
||||
*/
|
||||
function printR($var)
|
||||
{
|
||||
echo "<pre>";
|
||||
print_r($var);
|
||||
echo "</pre>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Fixes names to be used into the database or to name files
|
||||
* @author Felipe Nascimento
|
||||
* @name fixName
|
||||
* @param String $str
|
||||
* @return String
|
||||
*/
|
||||
public function fixName($str)
|
||||
{
|
||||
return preg_replace("/[^a-zA-Z0-9_]/", "", strtr(utf8_decode($str), "áàâãéêíóôõüçáàâãéêÍÓÔÕÜÇ- ", "aaaaeeioooucAAAAEEIOOOUC__"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the list of past saved ER Diagrams
|
||||
* @author Felipe Nascimento
|
||||
* @name getSavedERDList
|
||||
* @param String $projectName
|
||||
* @return Array
|
||||
*/
|
||||
function getSavedERDList($p)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$d= $_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$p.'/mind/er/';
|
||||
if(!file_exists($d))
|
||||
mkdir($d, 0777);
|
||||
$d= dir($d);
|
||||
$der= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0,1) !='.')
|
||||
array_push($der, preg_replace('/\.json$/', '', $entry));
|
||||
}
|
||||
return $der;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the data from a specific saved ER Diagram
|
||||
* @author Felipe Nascimento
|
||||
* @name getSavedERDItem
|
||||
* @param String $projectName
|
||||
* @param String $diagramName
|
||||
* @return JSon
|
||||
*/
|
||||
function getSavedERDItem($p, $d)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$d= file_get_contents($_MIND['rootDir'].$_MIND['userDir'].'/'.$_SESSION['user']['login'].'/temp/'.$p.'/mind/er/'.$d.'.json');
|
||||
return $d;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the list of registered plugins
|
||||
* @author Felipe Nascimento
|
||||
* @name getPlugins
|
||||
* @return Array
|
||||
*/
|
||||
function getPlugins()
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$d= $_MIND['rootDir'].$_MIND['pluginDir'];
|
||||
|
||||
$d= dir($d);
|
||||
$pList= Array();
|
||||
$pListName= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0, 1) != '.' && !isset($pListName[$entry]))
|
||||
{
|
||||
$pList[]= new Plugin($entry);
|
||||
$pListName[$entry]= true;
|
||||
}
|
||||
}
|
||||
return $pList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current version of the current project
|
||||
* @author Felipe Nascimento
|
||||
* @name currentVersion
|
||||
* @param &ProjectObject $p
|
||||
* @return Array
|
||||
*/
|
||||
function currentVersion(&$p)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$dir= $_MIND['rootDir'].$_MIND['publishDir'].'/'.$p->name;
|
||||
$dir.= '/conf.xml';
|
||||
|
||||
if($p->hasProject($p->name))
|
||||
{
|
||||
$conf= simplexml_load_file($dir);
|
||||
$ar = Array();
|
||||
$ar['version'] = (integer)$conf->version['value'];
|
||||
$ar['subVersion'] = (integer)$conf->subVersion['value'];
|
||||
$ar['update'] = (integer)$conf->update['value'];
|
||||
}
|
||||
$ar['date']= $conf->date['value'];
|
||||
return $ar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save any changes made to the options
|
||||
* @author Felipe Nascimento
|
||||
* @name saveOptions
|
||||
* @param Array $ar
|
||||
* @return void
|
||||
*/
|
||||
public function saveOptions($ar)
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$opXML= $_MIND['rootDir'].'config/options.xml';
|
||||
$xml= $_MIND['fw']->mkXML($opXML);
|
||||
|
||||
$xml->addChild('defaultIdiom');
|
||||
$xml->defaultIdiom['value']= $ar['defaultIdiom'];
|
||||
$xml->addChild('defaultDBMS');
|
||||
$xml->defaultDBMS['value']= $ar['defaultDBMS'];
|
||||
$xml->addChild('lookForUpdate');
|
||||
$xml->lookForUpdate['value']= $ar['lookForUpdate'];
|
||||
$xml->addChild('actionWithNewVersion');
|
||||
if(isset($ar['actionWithNewVersion']))
|
||||
$xml->actionWithNewVersion['value']= $ar['actionWithNewVersion'];
|
||||
else
|
||||
$xml->actionWithNewVersion['value']= '-1';
|
||||
$xml->addChild('actionWithNewSubVersion');
|
||||
if(isset($ar['actionWithNewSubVersion']))
|
||||
$xml->actionWithNewSubVersion['value']= $ar['actionWithNewSubVersion'];
|
||||
else
|
||||
$xml->actionWithNewSubVersion['value']= '-1';
|
||||
$xml->addChild('actionWithNewUpdates');
|
||||
if(isset($ar['actionWithNewUpdates']))
|
||||
$xml->actionWithNewUpdates['value']= $ar['actionWithNewUpdates'];
|
||||
else
|
||||
$xml->actionWithNewUpdates['value']= '-1';
|
||||
|
||||
// for I.Q. Options
|
||||
if(isset($ar['useGlobalSynDic']))
|
||||
$xml->addChild('useGlobalSynDic', $ar['useGlobalSynDic']);
|
||||
if(isset($ar['useLocalSynDic']))
|
||||
$xml->addChild('useLocalSynDic', $ar['useLocalSynDic']);
|
||||
if(isset($ar['addAutomatically']))
|
||||
$xml->addChild('addAutomatically', $ar['addAutomatically']);
|
||||
if(isset($ar['askForVerbs']))
|
||||
$xml->addChild('askForVerbs', $ar['askForVerbs']);
|
||||
if(isset($ar['askForTypes']))
|
||||
$xml->addChild('askForTypes', $ar['askForTypes']);
|
||||
if(isset($ar['reportDecisions']))
|
||||
$xml->addChild('reportDecisions', $ar['reportDecisions']);
|
||||
if(isset($ar['reportDoubts']))
|
||||
$xml->addChild('reportDoubts', $ar['reportDoubts']);
|
||||
if(isset($ar['enableMindUniverse']))
|
||||
$xml->addChild('enableMindUniverse', $ar['enableMindUniverse']);
|
||||
|
||||
$_MIND['fw']->saveXML($xml, $opXML);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the currently set options
|
||||
* @author Felipe Nascimento
|
||||
* @name loadOptions
|
||||
* @return Assoc Array
|
||||
*/
|
||||
public function loadOptions()
|
||||
{
|
||||
GLOBAL $_MIND;
|
||||
$op= $this->loadXML($_MIND['rootDir'].'config/options.xml');
|
||||
$opts = Array();
|
||||
$opts['defaultIdiom'] = (string)$op->defaultIdiom['value'];
|
||||
$opts['defaultDBMS'] = (string)$op->defaultDBMS['value'];
|
||||
$opts['lookForUpdate'] = (string)$op->lookForUpdate['value'];
|
||||
$opts['actionWithNewVersion'] = (string)$op->actionWithNewVersion['value'];
|
||||
$opts['actionWithNewSubVersion']= (string)$op->actionWithNewSubVersion['value'];
|
||||
$opts['actionWithNewUpdates'] = (string)$op->actionWithNewUpdates['value'];
|
||||
$opts['useGlobalSynDic'] = (string)$op->useGlobalSynDic;
|
||||
$opts['useLocalSynDic'] = (string)$op->useLocalSynDic;
|
||||
$opts['addAutomatically'] = (string)$op->addAutomatically;
|
||||
$opts['askForVerbs'] = (string)$op->askForVerbs;
|
||||
$opts['askForTypes'] = (string)$op->askForTypes;
|
||||
$opts['reportDecisions'] = (string)$op->reportDecisions;
|
||||
$opts['reportDoubts'] = (string)$op->reportDoubts;
|
||||
$opts['enableMindUniverse'] = (string)$op->enableMindUniverse;
|
||||
|
||||
return $opts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all the currently registered themes
|
||||
* @author Felipe Nascimento
|
||||
* @name getThemes
|
||||
* @return Array
|
||||
*/
|
||||
public function getThemes()
|
||||
{
|
||||
$c=0;
|
||||
GLOBAL $_MIND;
|
||||
$d = dir($_MIND['rootDir'].$_MIND['themeSrc']);
|
||||
$ar= Array();
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0, 1) != '.' && is_dir($_MIND['rootDir'].$_MIND['themeSrc'].'/'.$entry))
|
||||
{
|
||||
$ar[]= $entry;
|
||||
}
|
||||
$c++;
|
||||
}
|
||||
$d->close();
|
||||
return $ar;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function created to deal with possible errors
|
||||
* @author Felipe Nascimento
|
||||
* @name errorHandler
|
||||
* @param Integer $errno
|
||||
* @param String $errstr
|
||||
* @param String $errfile
|
||||
* @param Integer $errline
|
||||
* @return void
|
||||
*/
|
||||
function errorHandler($errno=499, $errstr="Internal Mind Error", $errfile=false, $errline=0)
|
||||
{
|
||||
switch($errno)
|
||||
{
|
||||
case E_USER_NOTICE:
|
||||
{
|
||||
echo 'Notice: '. $errstr.' - '.$errfile.' <br/>'.$errline.'<br/>-----------------------------------------<br/>';
|
||||
break;
|
||||
}
|
||||
case E_USER_ERROR:
|
||||
{
|
||||
@header("HTTP/1.0 ".$errno." Mind Error");
|
||||
echo $errstr;
|
||||
if($errfile)
|
||||
echo "<br/>File: " .$errfile." <br/>Line: ". $errline.'<br/>-----------------------------------------<br/>';
|
||||
exit;
|
||||
}
|
||||
case E_USER_WARNING:
|
||||
default:
|
||||
{
|
||||
@header("HTTP/1.0 ".$errno." Mind Warning");
|
||||
echo $errstr;
|
||||
if($errfile)
|
||||
echo "<br/>File: " .$errfile." <br/>Line: ". $errline.'<br/>-----------------------------------------<br/>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// instantiates the Framework itself and loas any extra required data
|
||||
$_MIND['fw']= new Mind();
|
||||
$_MIND['fw']->loadExternal();
|
||||
|
||||
// specifies who is the error handler for this application
|
||||
set_error_handler('errorHandler');
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.AS3 = function()
|
||||
{
|
||||
// Created by Peter Atoria @ http://iAtoria.com
|
||||
|
||||
var inits = 'class interface function package';
|
||||
|
||||
var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' +
|
||||
'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' +
|
||||
'extends false final finally flash_proxy for get if implements import in include Infinity ' +
|
||||
'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' +
|
||||
'Null Number Object object_proxy override parseFloat parseInt private protected public ' +
|
||||
'return set static String super switch this throw true try typeof uint undefined unescape ' +
|
||||
'use void while with'
|
||||
;
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
||||
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
|
||||
{ regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
|
||||
{ regex: new RegExp('var', 'gm'), css: 'variable' }, // variable
|
||||
{ regex: new RegExp('trace', 'gm'), css: 'color1' } // trace
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.AS3.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.AS3.aliases = ['actionscript3', 'as3'];
|
||||
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Bash = function()
|
||||
{
|
||||
var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le';
|
||||
var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
|
||||
'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
|
||||
'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
|
||||
'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
|
||||
'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
|
||||
'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
|
||||
'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
|
||||
'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
|
||||
'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
|
||||
'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
|
||||
'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
|
||||
'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
|
||||
'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
|
||||
'vi watch wc whereis which who whoami Wget xargs yes'
|
||||
;
|
||||
|
||||
this.findMatches = function(regexList, code)
|
||||
{
|
||||
code = code.replace(/>/g, '>').replace(/</g, '<');
|
||||
this.code = code;
|
||||
return SyntaxHighlighter.Highlighter.prototype.findMatches.apply(this, [regexList, code]);
|
||||
};
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
|
||||
{ regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
|
||||
];
|
||||
}
|
||||
|
||||
SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell'];
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.CSharp = function()
|
||||
{
|
||||
var keywords = 'abstract as base bool break byte case catch char checked class const ' +
|
||||
'continue decimal default delegate do double else enum event explicit ' +
|
||||
'extern false finally fixed float for foreach get goto if implicit in int ' +
|
||||
'interface internal is lock long namespace new null object operator out ' +
|
||||
'override params private protected public readonly ref return sbyte sealed set ' +
|
||||
'short sizeof stackalloc static string struct switch this throw true try ' +
|
||||
'typeof uint ulong unchecked unsafe ushort using virtual void while';
|
||||
|
||||
function fixComments(match, regexInfo)
|
||||
{
|
||||
var css = (match[0].indexOf("///") == 0)
|
||||
? 'color1'
|
||||
: 'comments'
|
||||
;
|
||||
|
||||
return [new SyntaxHighlighter.Match(match[0], match.index, css)];
|
||||
}
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
||||
{ regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
||||
{ regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword
|
||||
{ regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial'
|
||||
{ regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield'
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.CSharp.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp'];
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.ColdFusion = function()
|
||||
{
|
||||
// Contributed by Jen
|
||||
// http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus
|
||||
|
||||
var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' +
|
||||
'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' +
|
||||
'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' +
|
||||
'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' +
|
||||
'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' +
|
||||
'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' +
|
||||
'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' +
|
||||
'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' +
|
||||
'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' +
|
||||
'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' +
|
||||
'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' +
|
||||
'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' +
|
||||
'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' +
|
||||
'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' +
|
||||
'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' +
|
||||
'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' +
|
||||
'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' +
|
||||
'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' +
|
||||
'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' +
|
||||
'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' +
|
||||
'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' +
|
||||
'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' +
|
||||
'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' +
|
||||
'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' +
|
||||
'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' +
|
||||
'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' +
|
||||
'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' +
|
||||
'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' +
|
||||
'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' +
|
||||
'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' +
|
||||
'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' +
|
||||
'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' +
|
||||
'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' +
|
||||
'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' +
|
||||
'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' +
|
||||
'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' +
|
||||
'XmlValidate Year YesNoFormat';
|
||||
|
||||
var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' +
|
||||
'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' +
|
||||
'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' +
|
||||
'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' +
|
||||
'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' +
|
||||
'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' +
|
||||
'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' +
|
||||
'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' +
|
||||
'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' +
|
||||
'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' +
|
||||
'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' +
|
||||
'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' +
|
||||
'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' +
|
||||
'cfwindow cfxml cfzip cfzipparam';
|
||||
|
||||
var operators = 'all and any between cross in join like not null or outer some';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
||||
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions
|
||||
{ regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
|
||||
];
|
||||
}
|
||||
|
||||
SyntaxHighlighter.brushes.ColdFusion.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.ColdFusion.aliases = ['coldfusion','cf'];
|
||||
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Cpp = function()
|
||||
{
|
||||
// Copyright 2006 Shin, YoungJin
|
||||
|
||||
var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' +
|
||||
'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' +
|
||||
'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' +
|
||||
'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' +
|
||||
'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' +
|
||||
'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' +
|
||||
'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' +
|
||||
'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' +
|
||||
'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' +
|
||||
'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' +
|
||||
'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' +
|
||||
'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' +
|
||||
'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' +
|
||||
'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' +
|
||||
'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' +
|
||||
'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' +
|
||||
'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
|
||||
'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' +
|
||||
'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' +
|
||||
'__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' +
|
||||
'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' +
|
||||
'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' +
|
||||
'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' +
|
||||
'va_list wchar_t wctrans_t wctype_t wint_t signed';
|
||||
|
||||
var keywords = 'break case catch class const __finally __exception __try ' +
|
||||
'const_cast continue private public protected __declspec ' +
|
||||
'default delete deprecated dllexport dllimport do dynamic_cast ' +
|
||||
'else enum explicit extern if for friend goto inline ' +
|
||||
'mutable naked namespace new noinline noreturn nothrow ' +
|
||||
'register reinterpret_cast return selectany ' +
|
||||
'sizeof static static_cast struct switch template this ' +
|
||||
'thread throw true false try typedef typeid typename union ' +
|
||||
'using uuid virtual void volatile whcar_t while';
|
||||
|
||||
var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' +
|
||||
'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' +
|
||||
'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' +
|
||||
'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' +
|
||||
'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' +
|
||||
'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' +
|
||||
'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' +
|
||||
'fwrite getc getchar gets perror printf putc putchar puts remove ' +
|
||||
'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' +
|
||||
'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' +
|
||||
'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' +
|
||||
'mbtowc qsort rand realloc srand strtod strtol strtoul system ' +
|
||||
'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' +
|
||||
'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' +
|
||||
'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' +
|
||||
'clock ctime difftime gmtime localtime mktime strftime time';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
||||
{ regex: /^ *#.*/gm, css: 'preprocessor' },
|
||||
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' },
|
||||
{ regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' },
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' }
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Cpp.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Cpp.aliases = ['cpp', 'c'];
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.CSS = function()
|
||||
{
|
||||
function getKeywordsCSS(str)
|
||||
{
|
||||
return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
|
||||
};
|
||||
|
||||
function getValuesCSS(str)
|
||||
{
|
||||
return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
|
||||
};
|
||||
|
||||
var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
|
||||
'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
|
||||
'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
|
||||
'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
|
||||
'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
|
||||
'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
|
||||
'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
|
||||
'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
|
||||
'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
|
||||
'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
|
||||
'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
|
||||
'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
|
||||
'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
|
||||
'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
|
||||
|
||||
var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
|
||||
'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
|
||||
'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
|
||||
'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
|
||||
'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
|
||||
'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
|
||||
'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
|
||||
'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
|
||||
'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
|
||||
'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
|
||||
'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
|
||||
'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
|
||||
'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
|
||||
'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
|
||||
|
||||
var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
||||
{ regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
|
||||
{ regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes
|
||||
{ regex: /!important/g, css: 'color3' }, // !important
|
||||
{ regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
|
||||
{ regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
|
||||
{ regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
|
||||
];
|
||||
|
||||
this.forHtmlScript({
|
||||
left: /(<|<)\s*style.*?(>|>)/gi,
|
||||
right: /(<|<)\/\s*style\s*(>|>)/gi
|
||||
});
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.CSS.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.CSS.aliases = ['css'];
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Delphi = function()
|
||||
{
|
||||
var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' +
|
||||
'case char class comp const constructor currency destructor div do double ' +
|
||||
'downto else end except exports extended false file finalization finally ' +
|
||||
'for function goto if implementation in inherited int64 initialization ' +
|
||||
'integer interface is label library longint longword mod nil not object ' +
|
||||
'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' +
|
||||
'pint64 pointer private procedure program property pshortstring pstring ' +
|
||||
'pvariant pwidechar pwidestring protected public published raise real real48 ' +
|
||||
'record repeat set shl shortint shortstring shr single smallint string then ' +
|
||||
'threadvar to true try type unit until uses val var varirnt while widechar ' +
|
||||
'widestring with word write writeln xor';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *)
|
||||
{ regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { }
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
||||
{ regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags
|
||||
{ regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345
|
||||
{ regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Delphi.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Delphi.aliases = ['delphi', 'pascal', 'pas'];
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Diff = function()
|
||||
{
|
||||
this.regexList = [
|
||||
{ regex: /^\+\+\+.*$/gm, css: 'color2' },
|
||||
{ regex: /^\-\-\-.*$/gm, css: 'color2' },
|
||||
{ regex: /^\s.*$/gm, css: 'color1' },
|
||||
{ regex: /^@@.*@@$/gm, css: 'variable' },
|
||||
{ regex: /^\+[^\+]{1}.*$/gm, css: 'string' },
|
||||
{ regex: /^\-[^\-]{1}.*$/gm, css: 'comments' }
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Diff.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Diff.aliases = ['diff', 'patch'];
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Erlang = function()
|
||||
{
|
||||
// Contributed by Jean-Lou Dupont
|
||||
// http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html
|
||||
|
||||
// According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
|
||||
var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
|
||||
'case catch cond div end fun if let not of or orelse '+
|
||||
'query receive rem try when xor'+
|
||||
// additional
|
||||
' module export import define';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' },
|
||||
{ regex: new RegExp("\\%.+", 'gm'), css: 'comments' },
|
||||
{ regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' },
|
||||
{ regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' },
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Erlang.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Erlang.aliases = ['erl', 'erlang'];
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Groovy = function()
|
||||
{
|
||||
// Contributed by Andres Almiray
|
||||
// http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter
|
||||
|
||||
var keywords = 'as assert break case catch class continue def default do else extends finally ' +
|
||||
'if in implements import instanceof interface new package property return switch ' +
|
||||
'throw throws try while public protected private static';
|
||||
var types = 'void boolean byte char short int long float double';
|
||||
var constants = 'null';
|
||||
var methods = 'allProperties count get size '+
|
||||
'collect each eachProperty eachPropertyName eachWithIndex find findAll ' +
|
||||
'findIndexOf grep inject max min reverseEach sort ' +
|
||||
'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' +
|
||||
'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' +
|
||||
'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' +
|
||||
'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' +
|
||||
'transformChar transformLine withOutputStream withPrintWriter withStream ' +
|
||||
'withStreams withWriter withWriterAppend write writeLine '+
|
||||
'dump inspect invokeMethod print println step times upto use waitForOrKill '+
|
||||
'getText';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
||||
{ regex: /""".*"""/g, css: 'string' }, // GStrings
|
||||
{ regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword
|
||||
{ regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type
|
||||
{ regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants
|
||||
{ regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
||||
}
|
||||
|
||||
SyntaxHighlighter.brushes.Groovy.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Groovy.aliases = ['groovy'];
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.JScript = function()
|
||||
{
|
||||
var keywords = 'break case catch continue ' +
|
||||
'default delete do else false ' +
|
||||
'for function if in instanceof ' +
|
||||
'new null return super switch ' +
|
||||
'this throw true try typeof var while with'
|
||||
;
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
||||
{ regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript'];
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Java = function()
|
||||
{
|
||||
var keywords = 'abstract assert boolean break byte case catch char class const ' +
|
||||
'continue default do double else enum extends ' +
|
||||
'false final finally float for goto if implements import ' +
|
||||
'instanceof int interface long native new null ' +
|
||||
'package private protected public return ' +
|
||||
'short static strictfp super switch synchronized this throw throws true ' +
|
||||
'transient try void volatile while';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
||||
{ regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
|
||||
{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
||||
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
|
||||
{ regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
|
||||
{ regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
|
||||
];
|
||||
|
||||
this.forHtmlScript({
|
||||
left : /(<|<)%[@!=]?/g,
|
||||
right : /%(>|>)/g
|
||||
});
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Java.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Java.aliases = ['java'];
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.JavaFX = function()
|
||||
{
|
||||
// Contributed by Patrick Webster
|
||||
// http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
|
||||
var datatypes = 'Boolean Byte Character Double Duration '
|
||||
+ 'Float Integer Long Number Short String Void'
|
||||
;
|
||||
|
||||
var keywords = 'abstract after and as assert at before bind bound break catch class '
|
||||
+ 'continue def delete else exclusive extends false finally first for from '
|
||||
+ 'function if import in indexof init insert instanceof into inverse last '
|
||||
+ 'lazy mixin mod nativearray new not null on or override package postinit '
|
||||
+ 'protected public public-init public-read replace return reverse sizeof '
|
||||
+ 'step super then this throw true try tween typeof var where while with '
|
||||
+ 'attribute let private readonly static trigger'
|
||||
;
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' },
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' },
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
|
||||
{ regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers
|
||||
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
|
||||
];
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.JavaFX.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.JavaFX.aliases = ['jfx', 'javafx'];
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Perl = function()
|
||||
{
|
||||
// Contributed by David Simmons-Duffin and Marty Kube
|
||||
|
||||
var funcs =
|
||||
'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' +
|
||||
'chroot close closedir connect cos crypt defined delete each endgrent ' +
|
||||
'endhostent endnetent endprotoent endpwent endservent eof exec exists ' +
|
||||
'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' +
|
||||
'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' +
|
||||
'getnetbyname getnetent getpeername getpgrp getppid getpriority ' +
|
||||
'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' +
|
||||
'getservbyname getservbyport getservent getsockname getsockopt glob ' +
|
||||
'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' +
|
||||
'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' +
|
||||
'oct open opendir ord pack pipe pop pos print printf prototype push ' +
|
||||
'quotemeta rand read readdir readline readlink readpipe recv rename ' +
|
||||
'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' +
|
||||
'semget semop send setgrent sethostent setnetent setpgrp setpriority ' +
|
||||
'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' +
|
||||
'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' +
|
||||
'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' +
|
||||
'system syswrite tell telldir time times tr truncate uc ucfirst umask ' +
|
||||
'undef unlink unpack unshift utime values vec wait waitpid warn write';
|
||||
|
||||
var keywords =
|
||||
'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
|
||||
'for foreach goto if import last local my next no our package redo ref ' +
|
||||
'require return sub tie tied unless untie until use wantarray while';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' },
|
||||
{ regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
|
||||
{ regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' },
|
||||
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
|
||||
}
|
||||
|
||||
SyntaxHighlighter.brushes.Perl.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Perl.aliases = ['perl', 'Perl', 'pl'];
|
||||
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Php = function()
|
||||
{
|
||||
var funcs = 'abs acos acosh addcslashes addslashes ' +
|
||||
'array_change_key_case array_chunk array_combine array_count_values array_diff '+
|
||||
'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
|
||||
'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
|
||||
'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
|
||||
'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
|
||||
'array_push array_rand array_reduce array_reverse array_search array_shift '+
|
||||
'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
|
||||
'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
|
||||
'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
|
||||
'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
|
||||
'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
|
||||
'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
|
||||
'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
|
||||
'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
|
||||
'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
|
||||
'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
|
||||
'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
|
||||
'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
|
||||
'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
|
||||
'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
|
||||
'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
|
||||
'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
|
||||
'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
|
||||
'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
|
||||
'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
|
||||
'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
|
||||
'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
|
||||
'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+
|
||||
'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
|
||||
'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
|
||||
'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
|
||||
'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
|
||||
'strtoupper strtr strval substr substr_compare';
|
||||
|
||||
var keywords = 'and or xor array as break case ' +
|
||||
'cfunction class const continue declare default die do else ' +
|
||||
'elseif enddeclare endfor endforeach endif endswitch endwhile ' +
|
||||
'extends for foreach function include include_once global if ' +
|
||||
'new old_function return static switch use require require_once ' +
|
||||
'var while abstract interface public implements extends private protected throw';
|
||||
|
||||
var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
||||
{ regex: /\$\w+/g, css: 'variable' }, // variables
|
||||
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions
|
||||
{ regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Php.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Php.aliases = ['php'];
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Plain = function()
|
||||
{
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Plain.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Plain.aliases = ['text', 'plain'];
|
||||
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.PowerShell = function()
|
||||
{
|
||||
// Contributes by B.v.Zanten, Getronics
|
||||
// http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
|
||||
|
||||
var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +
|
||||
'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +
|
||||
'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +
|
||||
'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +
|
||||
'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +
|
||||
'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +
|
||||
'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +
|
||||
'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +
|
||||
'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +
|
||||
'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +
|
||||
'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +
|
||||
'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +
|
||||
'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +
|
||||
'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +
|
||||
'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +
|
||||
'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +
|
||||
'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +
|
||||
'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +
|
||||
'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +
|
||||
'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +
|
||||
'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';
|
||||
var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +
|
||||
'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +
|
||||
'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +
|
||||
'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +
|
||||
'spps spsv sv tee cat cd cp h history kill lp ls ' +
|
||||
'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +
|
||||
'erase rd ren type % \\?';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: /#.*$/gm, css: 'comments' }, // one line comments
|
||||
{ regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1
|
||||
{ regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' },
|
||||
{ regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' }
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.PowerShell.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.PowerShell.aliases = ['powershell', 'ps'];
|
||||
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Python = function()
|
||||
{
|
||||
// Contributed by Gheorghe Milas and Ahmad Sherif
|
||||
|
||||
var keywords = 'and assert break class continue def del elif else ' +
|
||||
'except exec finally for from global if import in is ' +
|
||||
'lambda not or pass print raise return try yield while';
|
||||
|
||||
var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' +
|
||||
'chr classmethod cmp coerce compile complex delattr dict dir ' +
|
||||
'divmod enumerate eval execfile file filter float format frozenset ' +
|
||||
'getattr globals hasattr hash help hex id input int intern ' +
|
||||
'isinstance issubclass iter len list locals long map max min next ' +
|
||||
'object oct open ord pow print property range raw_input reduce ' +
|
||||
'reload repr reversed round set setattr slice sorted staticmethod ' +
|
||||
'str sum super tuple type type unichr unicode vars xrange zip';
|
||||
|
||||
var special = 'None True False self cls class_';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
|
||||
{ regex: /^\s*@\w+/gm, css: 'decorator' },
|
||||
{ regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' },
|
||||
{ regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' },
|
||||
{ regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' },
|
||||
{ regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' },
|
||||
{ regex: /\b\d+\.?\w*/g, css: 'value' },
|
||||
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
|
||||
{ regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' }
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Python.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Python.aliases = ['py', 'python'];
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Ruby = function()
|
||||
{
|
||||
// Contributed by Erik Peterson.
|
||||
|
||||
var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
|
||||
'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
|
||||
'self super then throw true undef unless until when while yield';
|
||||
|
||||
var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
|
||||
'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
|
||||
'ThreadGroup Thread Time TrueClass';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
||||
{ regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants
|
||||
{ regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols
|
||||
{ regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
|
||||
{ regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Ruby.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Ruby.aliases = ['ruby', 'rails', 'ror', 'rb'];
|
||||
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Scala = function()
|
||||
{
|
||||
// Contributed by Yegor Jbanov and David Bernard.
|
||||
|
||||
var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' +
|
||||
'override try lazy for var catch throw type extends class while with new final yield abstract ' +
|
||||
'else do if return protected private this package false';
|
||||
|
||||
var keyops = '[_:=><%#@]+';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string
|
||||
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
||||
{ regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
|
||||
{ regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword
|
||||
];
|
||||
}
|
||||
|
||||
SyntaxHighlighter.brushes.Scala.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Scala.aliases = ['scala'];
|
||||
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*
|
||||
* @version
|
||||
* 2.1.364 (October 15 2009)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* This file is part of SyntaxHighlighter.
|
||||
*
|
||||
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Sql = function()
|
||||
{
|
||||
var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
|
||||
'current_user day isnull left lower month nullif replace right ' +
|
||||
'session_user space substring sum system_user upper user year';
|
||||
|
||||
var keywords = 'absolute action add after alter as asc at authorization begin bigint ' +
|
||||
'binary bit by cascade char character check checkpoint close collate ' +
|
||||
'column commit committed connect connection constraint contains continue ' +
|
||||
'create cube current current_date current_time cursor database date ' +
|
||||
'deallocate dec decimal declare default delete desc distinct double drop ' +
|
||||
'dynamic else end end-exec escape except exec execute false fetch first ' +
|
||||
'float for force foreign forward free from full function global goto grant ' +
|
||||
'group grouping having hour ignore index inner insensitive insert instead ' +
|
||||
'int integer intersect into is isolation key last level load local max min ' +
|
||||
'minute modify move name national nchar next no numeric of off on only ' +
|
||||
'open option order out output partial password precision prepare primary ' +
|
||||
'prior privileges procedure public read real references relative repeatable ' +
|
||||
'restrict return returns revoke rollback rollup rows rule schema scroll ' +
|
||||
'second section select sequence serializable set size smallint static ' +
|
||||
'statistics table temp temporary then time timestamp to top transaction ' +
|
||||
'translation trigger true truncate uncommitted union unique update values ' +
|
||||
'varchar varying view when where with work';
|
||||
|
||||
var operators = 'all and any between cross in join like not null or outer some';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
|
||||
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions
|
||||
{ regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Sql.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Sql.aliases = ['sql'];
|
||||
|
||||