Skip to content

Instantly share code, notes, and snippets.

View Logiks's full-sized avatar

Logiks : Framework Of Frameworks Logiks

View GitHub Profile
@Logiks
Logiks / index.php
Created December 20, 2016 09:29
Boilerplate for quick CMS/DGOffice Module
<?php
if(!defined('ROOT')) exit('No direct script access allowed');
loadModule("pages");
function pageContentArea() {
return "workspace";
}
function pageSidebar() {
return "sidebar";
@Logiks
Logiks / update-git.sh
Last active July 9, 2016 20:43
Search for all git sub projects, and updates them all.
#!/bin/sh
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull origin master" >tmp/update.log \;
@Logiks
Logiks / capcha.php
Created May 27, 2015 11:00
Captcha Usage In #Logiks
//This us a demo of how to use Captcha Widget In Logiks
//In Form
<INPUT NAME='USER_CAPTCHA_CODE' TYPE='TEXT' />
<?php
loadWidget("captcha");
?>
//This will generate the captcha and a captchaid in a hidden input field.
//On Server Side/Service section validate the captcha like this
<?php
@Logiks
Logiks / digioffice-module-apppage.php
Created May 18, 2014 23:54
Logiks boiler plate code for a basic DigiOffice plugin based on page module (apppage). Just put these to files in a custom made folder. rename 'digioffice-module-apppage.php' to 'index.php', and the module is ready to be used with a pretty decent gui of toolbar,sidebar and content space.
<?php
if(!defined('ROOT')) exit('No direct script access allowed');
//session_check(true);
loadModule("page");
$params["toolbar"]="printToolbar";
$params["contentarea"]="printContent";
printPageContent("apppage",$params);
@Logiks
Logiks / lgks-simple-module.php
Created April 24, 2014 14:55
This is a basic module boiler plate. Just create a folder in the plugins>modules folder, then create an index.php with the content of this gist, done a new module is created and can be loaded using loadModule('<module name>'); #Logiks-Boilerplates
<?php
//For security purpose
if(!defined("ROOT")) exit("Direct access to this file is not allowed.");
echo "Hello World Module ...";
?>
@Logiks
Logiks / content_home_layered.php
Created February 17, 2014 15:05
Sample content page for Home pages. This covers all the body of the home page not banner, footer etc. This considers the understanding the a home_layout.json file is found in <APPROOT>misc/jsondb #Logiks-Boilerplates
<?php
if(!defined('ROOT')) exit('No direct script access allowed');
loadModule("content");
if(!isset($json)) $json=new SimpleJSONDB();
$layouts=$json->getItem("home_layout","LAYOUTS");
//printArray($layouts);
$defWidgetConf=array(
@Logiks
Logiks / service.php
Created February 17, 2014 14:55
This works as boiler plate for starting any service file be it a global or a modules specific service. #Logiks-Boilerplates
<?php
if(!defined('ROOT')) exit('No direct script access allowed');
if(isset($_REQUEST["action"])) {
switch($_REQUEST["action"]) {
case "default":
$dataArr=array();
//Prints formated data to output stream be it xml,json,html,text or csv
printServiceMsg($dataArr);
break;
@Logiks
Logiks / pageContent.php
Created February 17, 2014 14:49
How to create content widget/component that displays content written using #Logiks CMS>Content Manager automatically in the page using url path.Using module#content #Logiks-Modules
<?php
//<sitepath>/about/terms
//The above path should show us content with name terms from about group.
$page=$_REQUEST['page'];
$page=explode("/",$page);
$category="about"; // default category for all contents in this page.
$contentID="about-us"; //default content for page may redirect to error page
if(count($page)>1) {
@Logiks
Logiks / widget-menubar.php
Created February 4, 2014 06:23
Generate Fully Nested Menubar using #Logiks CMS->Links and Menu. Using module#navigator #Logiks-Modules
<ul class="menubarUL">
<?php
$menuID="default";
loadModule("navigator",array(
"menuid"=>$menuID,
"menuType"=>"menubar"));
?>
</ul>
@Logiks
Logiks / widget-socialicons.php
Created February 4, 2014 06:22
Generate Social Links Using Social Feature File. This allows the social features to be able to manipulated using CMS->Configurations->Feature Settings. #Logiks-Core
<?php
$arrF=loadFeature("socials");
foreach($arrF as $a=>$b) {
if(strlen($b)<=0) continue;
echo "<li><a href='$b' target=_blank><img src='".
loadMedia("images/socials/".strtolower($a).".png")."' width=20px height=20px ></a></li>";
}
?>