Fixed some compile errors in relation to the adding of config fields to target a view menu relationship. Changed the notice area to give little reminder when new notice are sent.

This commit is contained in:
2016-10-31 23:47:21 +02:00
parent e63441531b
commit 07f9344265
375 changed files with 583 additions and 380 deletions

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage ajax.php
@@ -43,6 +43,55 @@ class ComponentbuilderModelAjax extends JModelList
}
// Used in component
/**
* Check and if a vdm notice is new (per/user)
**/
public function isNew($notice)
{
// first get the file path
$path_filename = ComponentbuilderHelper::getFilePath('user', 'notice', JFactory::getUser()->username, $fileType = '.md', JPATH_COMPONENT_ADMINISTRATOR);
// check if the file is set
if (($content = @file_get_contents($path_filename)) !== FALSE)
{
if ($notice == $content)
{
return false;
}
}
return true;
}
/**
* set That a notice has been read (per/user)
**/
public function isRead($notice)
{
// first get the file path
$path_filename = ComponentbuilderHelper::getFilePath('user', 'notice', JFactory::getUser()->username, $fileType = '.md', JPATH_COMPONENT_ADMINISTRATOR);
// set as read if not already set
if (($content = @file_get_contents($path_filename)) !== FALSE)
{
if ($notice == $content)
{
return true;
}
}
return $this->saveFile($notice,$path_filename);
}
protected function saveFile($data,$path_filename)
{
if (ComponentbuilderHelper::checkString($data))
{
$fp = fopen($path_filename, 'w');
fwrite($fp, $data);
fclose($fp);
return true;
}
return false;
}
// Used in admin_view
public function getImportScripts($type)
{

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage compiler.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage component.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php
@@ -266,6 +266,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList
$document = JFactory::getDocument();
$document->addScript(JURI::root() . "administrator/components/com_componentbuilder/custom/marked.js");
$document->addScriptDeclaration('
var token = "'.JSession::getFormToken().'";
var urlToGetAllOpenIssues = "https://api.github.com/repos/vdm-io/Joomla-Component-Builder/issues?state=open&page=1&per_page=5";
var urlToGetAllClosedIssues = "https://api.github.com/repos/vdm-io/Joomla-Component-Builder/issues?state=closed&page=1&per_page=5";
jQuery(document).ready(function () {
@@ -290,6 +291,24 @@ class ComponentbuilderModelComponentbuilder extends JModelList
});
});
});
// to check is READ/NEW
function getIS(type,notice){
if(type == 1){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.isNew&format=json";
} else if (type == 2) {
var getUrl = "index.php?option=com_componentbuilder&task=ajax.isRead&format=json";
}
if(token.length > 0 && notice.length){
var request = "token="+token+"&notice="+notice;
}
return jQuery.ajax({
type: "POST",
url: getUrl,
dataType: "jsonp",
data: request,
jsonp: "callback"
});
}
// nice little dot trick :)
jQuery(document).ready( function($) {
var x=0;
@@ -358,7 +377,29 @@ class ComponentbuilderModelComponentbuilder extends JModelList
jQuery(document).ready(function () {
jQuery.get(noticeboard)
.success(function(board) {
jQuery("#noticeboard-md").html(marked(board));
if (board.length > 5) {
jQuery("#noticeboard-md").html(marked(board));
getIS(1,board).done(function(result) {
if (result){
jQuery("#cpanel_tabTabs a").each(function() {
if (this.href.indexOf("#vast_development_method") >= 0) {
var textVDM = jQuery(this).text();
jQuery(this).html("<span class=\"label label-important vdm-new-notice\">1</span> "+textVDM);
jQuery(this).attr("id","vdm-new-notice");
jQuery("#vdm-new-notice").click(function() {
getIS(2,board).done(function(result) {
if (result) {
jQuery(".vdm-new-notice").fadeOut(500);
}
});
});
}
});
}
});
} else {
jQuery("#noticeboard-md").html("'.JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER').'");
}
})
.error(function(jqXHR, textStatus, errorThrown) {
jQuery("#noticeboard-md").html("'.JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER').'");

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage components.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage custom_admin_view.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage custom_admin_views.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dynamic_get.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dynamic_gets.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage field.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fields.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage adminviewfolderlist.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage adminviews.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage articles.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage customadminviews.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage customfilelist.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage customfolderlist.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage customgets.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dbtables.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dynamicgets.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fields.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldsmulti.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage maingets.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage siteviewfolderlist.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage siteviews.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage snippets.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtype.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.php

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage component.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage custom_admin_view.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage dynamic_get.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage field.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage fieldtype.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage help_document.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage layout.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage site_view.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage snippet.js

View File

@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage template.js

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage help_document.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage help_documents.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage import.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage layout.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage layouts.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage site_view.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage site_views.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage snippet.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage snippets.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage template.php

View File

@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@build 23rd October, 2016
@build 31st October, 2016
@created 30th April, 2015
@package Component Builder
@subpackage templates.php