while installing, as well as uninstalling your plugin.<br /><br /> Then, create a few folders under the root, and place the files that you want to be distributed with the plugin there - the structure is entirely up to you. You may want to put all your included PHP files under the includes directory, or you may not; you can put all images in a separate folder, or just keep them as siblings of the configuration file. <br /><br /> A plugin is described through a <b>QPlugin</b> object - you can see all the properties of that object by inspecting the <b><?php echo substr(__QCUBED_CORE__, strlen(__DOCROOT__)); ?> /framework/QPluginInterface.class.php</b> file. <a href="javascript:ViewSource(<?php _p(Examples::GetCategoryId() . ',' . Examples::GetExampleId() . ',"__CORE_FRAMEWORK__QPluginInterface.class.php"'); ?> );">Take a look </a>at it now.<br /><br /> To define the QPlugin object, we'll first set simple metadata on it: <div style="padding-left: 50px;"> <code> $objPlugin = new QPlugin();<br /> $objPlugin->strName = "MyCoolPlugin"; // no spaces allowed<br /> $objPlugin->strDescription = 'A great little plugin that does this and that';<br /> $objPlugin->strVersion = "0.1";<br /> $objPlugin->strPlatformVersion = "1.1"; // version of QCubed that this plugin works well with<br /> $objPlugin->strAuthorName = "Alex Weinstein, a.k.a. alex94040";<br /> $objPlugin->strAuthorEmail ="alex94040 [at] yahoo [dot] com"; </code>
<?php // The url to send to view_source.php // first encode the basic info $strCatId = Examples::GetCategoryId(); $strUrl = __VIRTUAL_DIRECTORY__ . __EXAMPLES__ . '/view_source.php/' . $strCatId . '/' . Examples::GetExampleId(); if ($strCatId == "plugin") { $strFile = Examples::GetPluginFile(); $strUrl .= '/' . $strFile . '/' . $strFile; } else { $strUrl .= '/' . basename(QApplication::$ScriptName); } if (!isset($mainPage)) { ?> <button id="viewSource">View Source</button> <?php } ?> </section> <footer> <div id="tagline"><a href="http://qcubed.github.com/" title="QCubed Homepage"><img id="logo" src="<?php _p(__VIRTUAL_DIRECTORY__ . __IMAGE_ASSETS__ . '/qcubed_logo_footer.png', false); ?> " alt="QCubed Framework" /> <span class="version"><?php _p(QCUBED_VERSION); ?> </span></a></div> </footer> <script type="text/javascript"> // jQuery isn't always available
<?php _p(Examples::GetCategoryId() + 1 . '. ' . Examples::$Categories[Examples::GetCategoryId()]['name'], false); ?> <br/> </span> <?php _p(Examples::PageName(), false); ?> <br/> <span class="headingLeftSmall"> <?php _p(Examples::PageLinks(), false); ?> </span> </td> <td class="headingRight"><br/> <b><a href="javascript:ViewSource(<?php _p(Examples::GetCategoryId() . ',' . Examples::GetExampleId()); ?> );" class="headingLink">View Source</a></b> <!-- <a href="#" onclick="window.open('http://localhost/validator/htdocs/check?uri=<?php _p(urlencode('http://qcodo/' . QApplication::$RequestUri)); ?> '); return false;" style="color: #ffffff;">Validate</a>--> <br/> <span class="headingLeftSmall">will open in a new window</span> </td> </tr> </table> <div class="page">
<script type="text/javascript"> // jQuery isn't always available var viewSource = document.getElementById('viewSource'); if (viewSource) { viewSource.onclick = function (){ var fileNameSection = "", objWindow; if (arguments.length == 3) { fileNameSection = "/" + strFilename; } objWindow = window.open("<?php echo __VIRTUAL_DIRECTORY__ . __EXAMPLES__; ?> /view_source.php/<?php _p(Examples::GetCategoryId() . "/" . Examples::GetExampleId()); ?> " + fileNameSection, "ViewSource", "menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=1000,height=750,left=50,top=50"); objWindow.focus(); return false; }; } window.gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { window.pageTracker = _gat._getTracker("UA-7231795-1"); pageTracker._trackPageview(); } catch(err) {} </script> </body>
<link rel="stylesheet" type="text/css" href="<?php _p(__VIRTUAL_DIRECTORY__ . __CSS_ASSETS__ . '/styles.css'); ?>"></link> <link rel="stylesheet" type="text/css" href="<?php _p(__VIRTUAL_DIRECTORY__ . __EXAMPLES__ . '/includes/examples.css'); ?>"></link> <script type="text/javascript"> function ViewSource(intCategoryId, intExampleId) { var objWindow = window.open("../view_source.php/" + intCategoryId + "/" + intExampleId, "ViewSource", "menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=1000,height=750,left=50,top=50"); objWindow.focus(); } </script> </head> <body> <table border="0" cellspacing="0" width="100%"> <tr> <td class="headingLeft"><span class="headingLeftSmall"> <?php _p((Examples::GetCategoryId() + 1) . '. ' . Examples::$Categories[Examples::GetCategoryId()]['name'], false); ?><br/> </span> <?php _p(Examples::PageName(), false); ?><br/> <span class="headingLeftSmall"> <?php _p(Examples::PageLinks(), false); ?> </span> </td> <td class="headingRight"><br/> <b><a href="javascript:ViewSource(<?php _p(Examples::GetCategoryId() . ',' . Examples::GetExampleId()); ?>);" class="headingLink">View Source</a></b> <!-- <a href="#" onclick="window.open('http://localhost/validator/htdocs/check?uri=<?php _p(urlencode('http://qcodo/' . QApplication::$RequestUri)); ?>'); return false;" style="color: #ffffff;">Validate</a>--> <br/> <span class="headingLeftSmall">will open in a new window</span> </td> </tr> </table> <div class="page">