Skip to content
Permalink
Browse files

first commit

  • Loading branch information...
lapico committed Apr 22, 2018
0 parents commit b75f1b6ffa52cc5ca5b7ea8836dde4d1d593063d
Showing with 13,067 additions and 0 deletions.
  1. BIN .DS_Store
  2. +27 −0 README.md
  3. BIN processreact.png
  4. BIN site-processreact/.DS_Store
  5. +4 −0 site-processreact/assets/index.php
  6. +42 −0 site-processreact/config.php
  7. BIN site-processreact/install/.DS_Store
  8. BIN site-processreact/install/files/.DS_Store
  9. BIN site-processreact/install/files/1020/04-die_schnsten_schweizer_bcher_2009_2.1200x900.jpg
  10. BIN site-processreact/install/files/1020/04-die_schnsten_schweizer_bcher_2009_2.260x0.jpg
  11. BIN site-processreact/install/files/1020/04-die_schnsten_schweizer_bcher_2009_2.400x300.jpg
  12. BIN site-processreact/install/files/1020/04-die_schnsten_schweizer_bcher_2009_2.400x400.jpg
  13. BIN site-processreact/install/files/1020/04-die_schnsten_schweizer_bcher_2009_2.800x600.jpg
  14. BIN site-processreact/install/files/1020/04-die_schnsten_schweizer_bcher_2009_2.jpg
  15. BIN site-processreact/install/files/1021/grauver.1200x900.jpg
  16. BIN site-processreact/install/files/1021/grauver.260x0.jpg
  17. BIN site-processreact/install/files/1021/grauver.400x300.jpg
  18. BIN site-processreact/install/files/1021/grauver.400x400.jpg
  19. BIN site-processreact/install/files/1021/grauver.800x600.jpg
  20. BIN site-processreact/install/files/1021/grauver.jpg
  21. BIN site-processreact/install/files/1022/dezeen_album-artwork-by-peter-saville3.0x260.jpg
  22. BIN site-processreact/install/files/1022/dezeen_album-artwork-by-peter-saville3.1200x900.jpg
  23. BIN site-processreact/install/files/1022/dezeen_album-artwork-by-peter-saville3.400x300.jpg
  24. BIN site-processreact/install/files/1022/dezeen_album-artwork-by-peter-saville3.400x400.jpg
  25. BIN site-processreact/install/files/1022/dezeen_album-artwork-by-peter-saville3.800x600.jpg
  26. BIN site-processreact/install/files/1022/dezeen_album-artwork-by-peter-saville3.jpg
  27. BIN site-processreact/install/files/1022/tschichold.0x260.png
  28. BIN site-processreact/install/files/1022/tschichold.1200x900.png
  29. BIN site-processreact/install/files/1022/tschichold.400x300.png
  30. BIN site-processreact/install/files/1022/tschichold.400x400.png
  31. BIN site-processreact/install/files/1022/tschichold.800x600.png
  32. BIN site-processreact/install/files/1022/tschichold.png
  33. +1 −0 site-processreact/install/files/README.txt
  34. +6 −0 site-processreact/install/info.php
  35. +507 −0 site-processreact/install/install.sql
  36. BIN site-processreact/modules/.DS_Store
  37. +132 −0 site-processreact/modules/Helloworld/Helloworld.module
  38. +40 −0 site-processreact/modules/InputfieldCKEditor/README.txt
  39. +24 −0 site-processreact/modules/InputfieldCKEditor/config-body.js
  40. +18 −0 site-processreact/modules/InputfieldCKEditor/config.js
  41. +121 −0 site-processreact/modules/InputfieldCKEditor/contents-inline.css
  42. +169 −0 site-processreact/modules/InputfieldCKEditor/contents.css
  43. +32 −0 site-processreact/modules/InputfieldCKEditor/mystyles.js
  44. +3 −0 site-processreact/modules/InputfieldCKEditor/plugins/README.txt
  45. +90 −0 site-processreact/modules/README.txt
  46. BIN site-processreact/templates/.DS_Store
  47. +1 −0 site-processreact/templates/README.txt
  48. +15 −0 site-processreact/templates/admin.php
  49. +11 −0 site-processreact/templates/basic.php
  50. BIN site-processreact/templates/client/.DS_Store
  51. +7 −0 site-processreact/templates/client/.babelrc
  52. +72 −0 site-processreact/templates/client/.eslintrc.json
  53. +10,138 −0 site-processreact/templates/client/package-lock.json
  54. +40 −0 site-processreact/templates/client/package.json
  55. BIN site-processreact/templates/client/public/.DS_Store
  56. BIN site-processreact/templates/client/public/dist/.DS_Store
  57. BIN site-processreact/templates/client/public/favicon.png
  58. +19 −0 site-processreact/templates/client/public/index.html
  59. +447 −0 site-processreact/templates/client/public/normalize.css
  60. +79 −0 site-processreact/templates/client/src/App.js
  61. +28 −0 site-processreact/templates/client/src/api.js
  62. 0 site-processreact/templates/client/src/index.css
  63. +88 −0 site-processreact/templates/client/src/index.js
  64. +30 −0 site-processreact/templates/client/webpack.config.js
  65. +11 −0 site-processreact/templates/errors/500.html
  66. +21 −0 site-processreact/templates/errors/README.txt
  67. 0 site-processreact/templates/home.php
  68. +409 −0 site-processreact/templates/inc/pagefields.php
  69. +326 −0 site-processreact/templates/inc/rest.php
  70. +49 −0 site-processreact/templates/nav.php
  71. +58 −0 site-processreact/templates/pages.php
  72. +1 −0 site-processreact/templates/scripts/main.js
  73. +1 −0 site-processreact/templates/styles/main.css
BIN +6 KB .DS_Store
Binary file not shown.
@@ -0,0 +1,27 @@
![ProcessReact](./processreact.png)

## ProcessWire Site Profile for React

ProcessReact is a boilerplate for getting started with ProcessWire as a headless CMS for React (with Redux & Axios).

### Credits

Based on [ProcessVue](https://github.com/microcipcip/processvue), [Blogpost](https://processwire.com/talk/topic/15790-vue-20-boilerplate-for-processwire-30/).

And on @gebeer [tutorial](https://processwire.com/talk/topic/11806-tutorial-building-a-simple-rest-api-in-processwire/).

### Installation

Install ProcessWire with this profile, which was exported using the [ProcessExportProfile](https://modules.processwire.com/modules/process-export-profile/) module.

Setup /site/templates/client/api.js with your server base URL.

Install React modules and start the client:

```
cd site/templates/client
npm install
npm start
```

Go to http://localhost:3030/
BIN +28.6 KB processreact.png
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
<?php
// Intentionally left blank to test that htaccess rewrite rules are working.
// Accessing this file from http should produce a '403 forbidden' error,
// since all PHP files are blocked under /assets/.
@@ -0,0 +1,42 @@
<?php
/**
* ProcessWire Configuration File
*
* Site-specific configuration for ProcessWire.
* This config.php file was generated by the ProcessExportProfile module.
*
* Please see the file /wire/config.php which contains all configuration options you may
* specify here. Simply copy any of the configuration options from that file and paste
* them into this file in order to modify them.
*
* ProcessWire
* Copyright (C) 2017 by Ryan Cramer
* Licensed under MPL 2.0
*
* https://processwire.com
*
*/
if(!defined("PROCESSWIRE")) die();
/*** SITE CONFIG *************************************************************************/
/**
* Enable debug mode?
*
* Debug mode causes additional info to appear for use during dev and debugging.
* This is almost always recommended for sites in development. However, you should
* always have this disabled for live/production sites.
*
* @var bool
*
*/
$config->debug = false;
$config->defaultAdminTheme = 'AdminThemeUikit';
/*** INSTALLER CONFIG ********************************************************************/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
This file is here to ensure Git adds the dir to the repo. You may delete this file.
@@ -0,0 +1,6 @@
<?php if(!defined("PROCESSWIRE_INSTALL")) die();
$info = array(
'title' => "",
'summary' => "",
'screenshot' => ""
);

Large diffs are not rendered by default.

Binary file not shown.
@@ -0,0 +1,132 @@
<?php namespace ProcessWire;

/**
* ProcessWire 'Hello world' demonstration module
*
* Demonstrates the Module interface and how to add hooks.
*
* See README file for further links regarding module development.
*
* This file is licensed under the MIT license
* https://processwire.com/about/license/mit/
*
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
* https://processwire.com
*
*/

class Helloworld extends WireData implements Module {

/**
* getModuleInfo is a module required by all modules to tell ProcessWire about them
*
* @return array
*
*/
public static function getModuleInfo() {

return array(

// The module's title, typically a little more descriptive than the class name
'title' => 'Hello World',

// version number
'version' => 3,

// summary is brief description of what this module is
'summary' => 'An example module used for demonstration purposes.',

// Optional URL to more information about the module
'href' => 'https://processwire.com',

// singular=true: indicates that only one instance of the module is allowed.
// This is usually what you want for modules that attach hooks.
'singular' => true,

// autoload=true: indicates the module should be started with ProcessWire.
// This is necessary for any modules that attach runtime hooks, otherwise those
// hooks won't get attached unless some other code calls the module on it's own.
// Note that autoload modules are almost always also 'singular' (seen above).
'autoload' => true,

// Optional font-awesome icon name, minus the 'fa-' part
'icon' => 'smile-o',
);
}

/**
* Initialize the module
*
* ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called
* when ProcessWire's API is ready. As a result, this is a good place to attach hooks.
*
*/
public function init() {

// add a hook after the $pages->save, to issue a notice every time a page is saved
$this->pages->addHookAfter('save', $this, 'example1');

// add a hook after each page is rendered and modify the output
$this->addHookAfter('Page::render', $this, 'example2');

// add a 'hello' method to every page that returns "Hello World"
// use "echo $page->hello();" in your template file to display output
$this->addHook('Page::hello', $this, 'example3');

// add a 'hello_world' property to every page that returns "Hello [user]"
// use "echo $page->hello_world;" in your template file to display output
$this->addHookProperty('Page::hello_world', $this, 'example4');
}

/**
* Example1 hooks into the pages->save method and displays a notice every time a page is saved
*
* @param HookEvent $event
*
*/
public function example1($event) {
/** @var Page $page */
$page = $event->arguments[0];
$this->message("Hello World! You saved {$page->path}.");
}


/**
* Example2 hooks into every page after it's rendered and adds "Hello World" text at the bottom
*
* @param HookEvent $event
*
*/
public function example2($event) {

/** @var Page $page */
$page = $event->object;

// don't add this to the admin pages
if($page->template == 'admin') return;

// add a "Hello World" paragraph right before the closing body tag
$event->return = str_replace("</body>", "<p>Hello World!</p></body>", $event->return);
}

/**
* Example3 adds a 'hello' method (not property) to every page that simply returns "Hello World"
*
* @param HookEvent $event
*
*/
public function example3($event) {
$event->return = "Hello World";
}

/**
* Example 4 adds a 'hello_world' property (not method) to every page that returns "Hello [user]"
*
* @param HookEvent $event
*
*/
public function example4($event) {
$event->return = "Hello " . $this->user->name;
}

}
@@ -0,0 +1,40 @@
This InputfieldCKEditor directory is here to provide optional extra configuration options
and plugins to the CKEditor Inputfield module.


plugins/
========
Directory to place additional CKEditor plugins in. You can then activate them
from your CKEditor field settings.


contents.css
============
Example CSS file for the admin editor. To make CKEditor use this file, go to your CKEditor
field settings and specify /site/modules/InputfieldCKEditor/contents.css as the regular
mode Contents CSS file.


contents-inline.css
===================
Same as contents.css but for the inline mode editor.


mystyles.js
===========
Optional configuration for the CKEditor Styles option. To use this file, go to your
CKEditor field settings and set the Custom Styles Set to be this file.


config.js
=========
Custom config file used by all CKEditor instances (except instances configured by their
own custom config file, see below...)


config-body.js
==============
Example of field-specific custom config file. This one applies to a field named "body".
Note that these config settings can also be specified directly in your CKEditor field
settings in the admin, which many may prefer.

@@ -0,0 +1,24 @@
/**
* CKEditor field-specific (body) custom config file for ProcessWire
*
* Use this file to specify additional config options to a field named "body".
* This is here just for example purposes. If you wanted to create a config
* specific to some other field, like "sidebar", you would create another file
* exactly like this named: config-sidebar.js
*
* If you wanted to use the same config.js for all of your CKEditor fields,
* you would remove this file and just use the config.js file instead. Meaning,
* this file completely overrides config.js if the field being edited is named
* "body". The regular config.js file is not loaded when this one is loaded.
*
*/

/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.uiColor = '#AADC6E';
};
@@ -0,0 +1,18 @@
/**
* CKEditor custom config file for ProcessWire
*
* Use this file to specify additional config options to all CKEditor instances,
* except those that have field-specific config files, i.e. config-body.js for
* config specific to a field named "body".
*
*/

/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.uiColor = '#AADC6E';
};

0 comments on commit b75f1b6

Please sign in to comment.
You can’t perform that action at this time.